: Things have changed a tad bit since this was originally answered. I also think they are missing a vital point: Though adding more dynos do not increase the performance, these days you now
Things have changed a tad bit since this was originally answered. I also think they are missing a vital point:
Though adding more dynos do not increase the performance, these days you now have the option to chose different dyno sizes as well. However, before you go all nuts with the new sizes, see: Optimizing Dyno Usage: CPU
The different dyno sizes do offer different CPU performance
characteristics, and will aid a little in a high-CPU situations, but
ideally you should consider offloading work to a background worker as
a first step in optimization, as well as optimizing the code.
In production, you should always have at least two 1 x dynos or one 2 x dyno. When you run the "production check" on Heroku, it will complain if you're running the free 1 dyno account. This is because free accounts do not stay in stand-by, but when inactive for a while the dyno is shutdown and then when a request comes in it has to start the dyno from scratch and load the environment before it can even begin serving the request. This will of course add a massive delay. See: Dyno sleeping for more information, and consider Dyno Redundancy too.
So to sum it up. If you have only one dyno then you should add another one, or opt to use a 2 x dyno to prevent idle sleeping (and possibly increasing redundancy). Some CPU performance can be obtained through adjusting the dyno sizes, but the main ways to really boost CPU intensive application is through background jobs, architecture, and generally improving code efficiency.
P.S. Sure, you could set up some sort of polling for the app every hour and circumvent this policy that way, but hey let's be fair here - isn't that just cheating? You don't think Heroku deserves some pennies for running your (albeit small, but hopefully nicely working) app? :)
More posts by @Welton855
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.