jeudi 30 août 2018

Setting database connection pool size for delayed_job?

I'm trying to understand database connection pools in Rails, and starting to get somewhere :)

I understand the default pool size is 5. In Unicorn you can set the pool size as a config, which will be the pool of connections per Unicorn worker process. So if you have 2 dynos each running 3 processes, and you're using the default pool of 5, you could have up to 2*3*5=30 database connections open.

I'm also using background workers, but not sure how I'd set the pool size there. I checked, and even if I set the pool as 2 for Unicorn, the worker process still has the default pool of 5. Is there a simple way to set the pool size for background workers using delayed_job?

Aucun commentaire:

Enregistrer un commentaire