On a our Heroku Rails 4.2 web app running Unicorn workers, where each worker needs about 230MB, we can run 2 per '1X' Heroku dyno, or 4 per '2X' Heroku dyno. CPU requirements are quite low.
If we need 8 workers to handle our traffic, what are the technical / performance tradeoffs of using four '1X' dynos vs. two '2X' dynos to get 8 workers?
(Two years ago there was a well-publicized issue with the way Heroku was routing to dynos that as I recall suggested larger dynos with more workers worked best because there was less chance of a request being routed to a 'busy' dyno. But I'm not finding any current guidelines on when it is best to use larger dynos vs more dynos.)
As far as I know as you already mentioned Heroku routers don't know and care about load in a specific dyno and sends the request by a random selection algorithm. https://devcenter.heroku.com/articles/http-routing
So it is very likely to see many consecutive requests going to same dyno. I am observing that behaviour with my current applications.
But in your case if a worker need 230MB then you can't use 2 worker in a Standard-1X dyno because their max memory is 512M. So I think you should definitely go for 2X dynos with like 3-4 workers. 2X dynos can use up to 1GB memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With