Heroku: web dyno vs. worker dyno? How many/what ratio do I need?

Your best indication if you need more dynos (aka processes on Cedar) is your heroku logs. Make sure you upgrade to expanded logging (it’s free) so that you can tail your log.

You are looking for the heroku.router entries and the value you are most interested is the queue value – if this is constantly more than 0 then it’s a good sign you need to add more dynos. Essentially this means than there are more requests coming in than your process can handle so they are being queued. If they are queued too long without returning any data they will be timed out.

There’s no ideal ratio I’m afraid, you could have an app doing 100 requests a second needing many web processes but just doesn’t make use of workers. You only need worker processes if you are doing processing in the background like sending emails etc etc.

ps Backlog too deep would be a Dyno web process that would cause it.

UPDATE: On March 26 2013 Heroku removed queue and wait fields from the log out put.

queue and wait fields have been removed from router log messages.
Also, the Heroku router no longer sets X-Heroku-Dynos-In-Use,
X-Heroku-Queue-Depth and X-Heroku-Queue-Wait-Time HTTP headers for
incoming requests.

Leave a Comment