perf(stats): read peers from instances, update every 5 minutes

The peers query read the nickname of every remote user every minute
(2.7 s and 1.2M buffer hits on a large instance). The instances table
now has a row for every host we know users from, so read it instead,
and recompute the stats every 5 minutes.

Based on Akkoma 138b1aea2 and 7b76fdeed.

Co-authored-by: Oneric <oneric@oneric.stub>
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
This commit is contained in:
Lain Soykaf 2026-10-27 20:49:52 +04:00
commit e8f238359f
No known key found for this signature in database
3 changed files with 11 additions and 13 deletions

View file

@ -0,0 +1 @@
Read the peer list from the instances table and update instance stats every 5 minutes instead of every minute; the old peers query was one of the most expensive regular queries