Server hitting 100% CPU

Any idea how why a server can sometimes hit 100% and then stay until a hard reset?

The server was running fine for weeks at a time and then hit 100% CPU. Only a hard restart would fix it. This is the DO graph:

It may have been caused by the spiderable package. I didn’t realise I was using it on this project till just now. Although the server doesn’t have a domain name attached to it (IP address only). Could spiderable still have been the cause?

You may already know this but I figure I’ll mention it just in case. Digital Ocean servers are pretty easy to hack if not properly secured. I’ve seen hackers hijack DO servers and then use them for DDOS attacks that will cause the server resource utilization to skyrocket. Most of the time DO will catch it and send you a message, but that could be part of your problem.

I didn’t this. Interesting to know. Thanks. Is there a specific place I can read about this online?

I’d just make sure that your server is properly setup. Here are some good intro articles on getting things setup correctly (this is for Ubuntu):

Some things to do: Check your logs for suspicious behavior (/var/log/ - syslog, upstart logs). Check that your firewall is up (explained in the second article).

In addition, if you’re interested in setting up the server from scratch you can check out this article: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04 It goes into detail about how to setup an app and web server that talk to each other over private networking channels.

If it looks like your security is solid and you are still experiencing issues then it might just come down to your code. Sometimes a lack of error handling and or infinite loops could trigger something like this.

1 Like

Spiderable should do this for an extended period of time but you may want to remove it for a few days to check. Prerender.io is a much better solution IMHO.

5 Likes

Does it work with SSL in the free version? Just added the Meteor package of Preprender but with force-ssl it didn’t work for me.