My app can take 60 or so concurrent users on a single instance 512mb digitalocean droplet.
Last night it hit that limit and then the droplet stayed at 100% cpu. The site was unreachable and I couldn’t even ssh into the app. I had to go to the digitalocean admin panel and click reset to get things working again. The site was down for a good 6 hours or so.
Why would something like this happen? I know spiderable can cause these issues but I’m not using it in my app (using prerender.io instead). What I don’t understand is that even if the app is going to hit 100pc CPU, why would it stay there for hours on end and not drop back down once users start disconnecting?
Highly doubt it’s an infinite loop in my code. This only happens when the
CPU gets high. The app has been running on another domain for two years and
when running multiple instances this doesn’t ever happen.
But I launched another version of the app on a new domain and not realising
the heavy load I’d get didn’t set up multiple instances and hit the 100%
CPU problem.
Follow @iDoMeteor’s advice and wire up Kadira (Kadira APM will be more effective if this is only happening in production). You need to get eyes on what’s happening inside your app. Kadira is a prod app life saver.