Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Worker, Threads & Pool size using Puma

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?

like image 407
sandelius Avatar asked Feb 02 '15 11:02

sandelius


1 Answers

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.

like image 146
tommasop Avatar answered Nov 15 '22 19:11

tommasop