I had some thoughts on setting the appropriate pool size (in database.yml).
I saw a similar question in what is the use of the pool option in the database.yml file , but for this you need to understand even more.
Here is my setup. I have Unicorn instances with 5 workflows. I also have Sidekiq instances with concurrency set to 5 (I'm asumming thats 5 simultaneous threads).
What should I consider for pool size? What other factors should be considered?
This is my understanding so far (as quoted by the engineer I spoke with before):
Suppose you leave it at default 5. This simply means that inside βa is a single processβ, the pool size is 5. The pool per process. It is not system-wide, so a value of 5 does not mean that you are limited to 5 processes, it means that each process has its own pool of size 5.
In general , each instance has a db pool size of 5. This also means that the db pool size is not wide, but for each process / instance. It also means that Sidekiq and Unicorn will work in their own example. It will have its own db 5 pool size. Is this an assumption correct?
At this point, I can assume that the default pool size of 5 is generally safe. Your thoughts?
PS. If you can share your pool size for your AWS RDS instances. That would be appreciated.
database ruby-on-rails postgresql ruby-on-rails-4
Christian fazzini
source share