Hello Jeremy,

We tried to play around with concurrency and (database) connection limit 
and were not sure how to correctly set (database) connection pool.
Do you think these calculations are correct?

   - Platform: Heroku
   - Dynos: 2
   - Webserver: Puma
   - Puma workers (processes): 4
   - Max threads per worker: 10

Therefore:

   - Max number of connections: 2 dynos * 4 workers * 10 threads = 80 
   connections
   - Number of pools: 2 dynos * 4 workers = 8 pools in total
   - Connection pool size: 10 threads = 10 connections
   - Which multiplies back to 80

Or the other way around, if I have 20 connections limit, I can do the 
following:

   - 
   - 2 dynos * 2 workers * 5 thread   = 20 connections (pool is 5)
   - 1 dyno  * 2 workers * 10 threads = 20 connections (pool is 10)
   - 1 dyno  * 1 worker  * 20 threads = 20 connections (pool is 20)
   - ...

I decided to summarize it in a 
repo https://github.com/ollie/connection-pool-concurrency.
This doesn't only apply to Sequel but anything with connection pool like 
Redis and Memcached, right?

Thank you,
Ollie

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to