Performance: Difference between revisions

168 bytes added ,  00:02, 26 November 2023
no edit summary
No edit summary
No edit summary
Line 93: Line 93:
We want to split up sidekiq into multiple processes using separate systemd service files. We want to a) make the site responsive by processing high-priority queues quickly but also b) use all our available resources by not having processes sit idle. So we give each of the main queues one service file that has that queue as the top prioriry, and mix the other queues in as secondary priorities - sidekiq will try and process items from the first queue first, second queue second, and so on.
We want to split up sidekiq into multiple processes using separate systemd service files. We want to a) make the site responsive by processing high-priority queues quickly but also b) use all our available resources by not having processes sit idle. So we give each of the main queues one service file that has that queue as the top prioriry, and mix the other queues in as secondary priorities - sidekiq will try and process items from the first queue first, second queue second, and so on.


So we allocate 25 threads (and 25 db connections) each to four service files with the following priority orders.  
So we allocate 25 threads (and 25 db connections) each to four service files with the following priority orders. Note that we **only do this after increasing the maximum postgres connections to 200,** see https://hazelweakly.me/blog/scaling-mastodon/#db_pool-notes-from-nora's-blog


* default, ingress, pull, push
* default, ingress, pull, push