3 ms·
You might want to double-check your DB pooling numbers. Running out of DB connections can end up looking a lot like heavy CPU usage on Ruby. This bottleneck pr
by kondro 4y ago
You might want to double-check your DB pooling numbers. Running out of DB connections can end up looking a lot like heavy CPU usage on Ruby.
This bottleneck probably relates to the delivery of new messages to feeds. That's the busiest part of the backend and requires 5-7 DB requests and a bunch of Redis requests per recipient from a post on your server.
I'm sure spending time just on making this part of the platform more efficient would have massive impacts on performance across on a Mastodon instance.
- kstrauser 4y agoThat part’s fine. I’m sitting being PgBouncer, and neither it nor PostgreSQL are anywhere near their connection limits. I sincerely wish that were the issue so I could configure my way around it.
- kondro 4y agoYes, but are the connection pools in Rails & Sidekiq configured for a very large number of connections. You can probably squeeze up to 100+ out of a single process.
- kstrauser 4y agoI’ve got a pool of 100 DB connections for each Sidekiq process, and haven’t gotten any errors related to lack of connections. For real, I’ve troubleshot this to hell and back. Mastodon’s Sidekiq processes eat servers for breakfast.