I'm working on a iPhone application that will communicate with a rails app hosted on Heroku. I'm wondering how i should size the server (how many dynos, workers, and what type of database)
From what i understand a worker can perform i single operation at a time (ex: performing a select in database), and a dyno can handle between 10 and 100 simultaneous request.
If the phone has a low connection, requ开发者_运维百科ests might take a long time, how will this affect my server ?
I guess the longer the request are the more concurrent request there will be, so it requires more dyno ? But it shouldn't affect the required number of worker, right ?
And how about the standard database, apart from the 5Mo limit, is it too slow for 10 to 100 simultaneous request ? (each performing very simple Select on a less than 5Mo database ?)
Thanks, Vincent
It's important to remember that a single dyno is single threaded, so if your response time (use New Relic here) is say 200ms you're (in theory) able to process 5 requests a second with a single dyno. Increasing dynos does not increase performance, it increases throughput - to put this in perspective we recently needed to scale an app rapidly after advertising and ended up running on around 45 dynos (probably overkill) and were dealing with around 5600 requests a minute so approximately 100 requests a second. Also remember that if a dyno is kept in use (long running request, upload etc) then if you don't have additional dynos to process then requests will be queued and that queue will eventually be timed out after 30 seconds.
We're running off the 20Gb database and have seen impressive figures in DB response time, of course the site is also using a Memcached layer too to keep it snappy.
Hope that helps,
John.
精彩评论