Skip to content

Recommended worker_processes configuration #103

Closed Answered by casperisfine
thedentist8 asked this question in Q&A
Discussion options

You must be logged in to vote

the general rule of thumb is to configure the number of workers the same as the number of CPU cores.

That is true for servers that use threads such as Puma.

For Pitchfork or Unicorn, since processes are mostly idle when doing IOs, the recommendation is to have more processes than CPU cores to increase utilization.

Like many other things, it's a latency vs throughput tradeoff. If you wish to get latency as low as possible at all costs, 1 process per core is the way to go.

If you are trying to squeeze as much throughput as possible out of a given server, then adding more processes until system metrics show processes are queuing to be executed is the way to go.

And of course there is poten…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by casperisfine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants