Tuning Puma Webserver with Rails

Referencing this

One of the maintainers states:

The only time you should run more than 1 worker per core is if you are running with 1 thread in the threadpool (e.g. threads 1,1)

Heroku is a special case. As their chart says, you are not actually getting 1 vCPU - it is “n/a”. That’s because eco/basic/standard dynos on Heroku are actually cpu-timesliced across 8 vCPUs (not guaranteed, this is just how it is implemented last time I checked). So on Heroku, their advice makes sense, because there is actually more than 1 logical core available.

For the Standard compute tier on Render - would we be configuring Puma to run as one worker on a single core or more because we’re on shared vCPU?

thanks!

Hi there,

There is no one right answer to this question. You will need to find the right combination what works best for your service, and every service may behave differently.

I would recommend you start by trying between 1-3 workers and around 5 threads. Then let your service run while checking the CPU and memory metrics. Better still, set up some performance tests for your service and then check your metrics.

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.