Search code examples
ruby-on-railswebserverpuma

How many Puma Cluster Workers are recommended?


How many Puma Cluster Workers are recommended? What if I would like to run multiple Pumas on one Server regarding the Puma Cluster Worker count?


Solution

  • There's no recommended number of Puma workers, it's a matter for tuning your code and resources to match your application's load.

    Running multiple Puma instance on a single server is exactly what the cluster mode was designed for, so it's a good idea. But note that puma allows for two different levels of concurrency configuration - number of threads per worker and number of workers - it's important to understand each of this options to get the most out of your resources.

    I suggest reading the following: https://github.com/jrochkind/fake_work_app

    It's a comparison of various Ruby web servers but I'm referencing it here because it explains very well the level and method of concurrency each of the servers supply, including puma.