High CPU Usage Causes Server Power Off-Collection of common programming errors
My first post here, so apologies if anything is missing.
I currently have an Ubuntu hosted VPS, which periodically runs a PHP script which does a lot of regex processing and interaction with a local MySQL database (this is running Percona server).
It is a dual core VPS, and at one point when the script runs, the processors jump to 100% each for a period of time. I run a mbstat -P 0,1 1
to report the CPU usage, and it is pretty much a minute of high usage, and the server turns itself off – it doesn’t shutdown, it powers off.
My provider is suggesting that this is a software (OS) problem. I have recently updated the Kernel, but I cannot find anything relating to settings that would cause the server to power down completely.
I have looked through all the logs I can find (through /var/log
anyway) and can’t find anything of note. Not even anything in there saying that it’s being powered down or there is a problem. This is what led me to think that this may be a provider setting that shuts the VPS down when it sees high CPU use.
Ubuntu Version: 12.04.3 LTS x64 Kernel Version: 3.2.0-54-generic
Please let me know if you require any other information. Any help that anyone could offer would be much appreciated.
Thanks!
-
Could you limit the PHP script in such a way that it only uses 1 CPU? If your assumption about the provider is true, the machine wouldn’t shut down if only one CPU is used, I guess.
Is it possible that you run out of memory? That may lead to a shutdown of several processes and maybe result in a complete crash/shutdown. Do you have swap space enabled?