Worker, Threads & Pool size using Puma

sandelius picture sandelius · Feb 2, 2015 · Viewed 11.7k times · Source

If I have a server with 1 core, how many puma workers, threads and what database pool size is appropriate?

What's the general thumb here?

Answer

tommasop picture tommasop · May 2, 2015

Not an easy answer.

The two main sources of information are:

  1. Puma github repository (the authors' point of view)
  2. Heroku's web page (the main big user's point of view)

Unfortunately they are inconsistent mostly because heroku has different deployment metrics and terminology.

So I ended up following the puma repository guidelines which says:

  • One worker per core
  • Threads to be determined in connection with RAM availability and application and
  • Threads = Connection Pool

So the number of threads is mostly a try and check operation.