Use sidekiq concurrency field to set DB_POOL#160
Use sidekiq concurrency field to set DB_POOL#160abbottmg wants to merge 1 commit intomastodon:mainfrom
Conversation
|
As far as I can tell this should be fine, though @renchap is more familiar with exactly how this work, and can confirm whether this should be alright. |
|
I do not think this is needed, Mastodon already sets the pool size to the Sidekiq concurrency: https://github.com/mastodon/mastodon/blob/main/config/database.yml#L3 |
In a vacuum, you are correct. However, deployment-sidekiq imports configmap-env, which in turn always sets This change was prompted by my single-thread Looking at this with fresh eyes: if we decide to rely on the upstream line, it may be best to remove DB_POOL from the configMap altogether, since we already set |
|
Ha, this is unfortunate. Why dont we remove |
|
If we want to remove |
|
Just merged #190 which removes |
There are really two stages to this PR to consider.
The easy one is allowing deployment-sidekiq to set the
DB_POOLenv variable per sidekiq worker definition. The second one specifically sets it to the concurrency value rather than using an independent key. My memory is that sidekiq should never need more DB connections than it has threads, so this reduces connection overhead for workers with low duty cycles (eg a worker dedicated to one of the scheduler, mailers, and potentially ingress queues).