unsure if this (the screenshot) is normal but the moment someone with a ton of followers replied to me all i could see for 10 seconds was the light of heaven. aka a white screen. i think i should increase the number of open connections now
Conversation
Notices
-
Embed this notice
Kirby (kirby@fanimations.club)'s status on Wednesday, 19-Aug-2026 20:42:13 JST
Kirby
-
Embed this notice
silverpill (silverpill@mitra.social)'s status on Wednesday, 19-Aug-2026 20:42:11 JST
silverpill
@kirby I've noticed this too. When Mastodon sees your post for the first time, it starts making various queries, some of them are expensive (e.g. fetching replies). When hundreds of Mastodon servers do this at the same time, the instance may become unresponsive.
In my case, the bottleneck is likely the number of database connections in mitra's connection pool, which by default is proportional to the number of CPU cores. How many CPU cores do you have on your machine?
-
Embed this notice
Kirby (kirby@fanimations.club)'s status on Wednesday, 19-Aug-2026 20:42:12 JST
Kirby
okay doubled the number of open postgres connections. hopefully 40 will be more than enough to handle any sort of natural cavalry that slams fanimations
-
Embed this notice
silverpill (silverpill@mitra.social)'s status on Wednesday, 19-Aug-2026 21:32:42 JST
silverpill
@phnt @kirby There is still a couple of low-hanging fruits in mitra. For example, object ID lookup results in a database query that loads an entire thread (similar to /api/v1/statuses/{status_id}/context).
-
Embed this notice
Phantasm (phnt@fluffytail.org)'s status on Wednesday, 19-Aug-2026 21:32:43 JST
Phantasm
@silverpill @kirby It's the click of death, you can't really do much about it besides in-memory caching objects and actor representations. The load can easily go to 500 r/s for 30 seconds or more. -
Embed this notice
silverpill (silverpill@mitra.social)'s status on Wednesday, 19-Aug-2026 21:37:55 JST
silverpill
It doesn't need much RAM but
>a single core
this means mitra's database connection pool only contains two connections (num_cpus * 2) and can be easily exhausted
You can increase the pool size using the database_connection_pool_size configuration option. I think raising it from 2 to 4 should have a significant effect.
-
Embed this notice
Kirby (kirby@fanimations.club)'s status on Wednesday, 19-Aug-2026 21:37:56 JST
Kirby
@silverpill I guess it doesn't help that I only have a gig of ram and a single core on the crappy VPS I'm running Mitra on. Either way I suspected the same thing you said and I doubled it from 20 to 40. (lol the post you replied to says this) Though there's still lag at times. It'd be good to move it to my proper server with like 24 cores and 32 gigs of ram.
-
Embed this notice