{"id":2675,"date":"2022-08-30T15:26:50","date_gmt":"2022-08-30T15:26:50","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/06\/high-cpu-usage-causes-server-power-off-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:26:50","modified_gmt":"2022-08-30T15:26:50","slug":"high-cpu-usage-causes-server-power-off-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/high-cpu-usage-causes-server-power-off-collection-of-common-programming-errors\/","title":{"rendered":"High CPU Usage Causes Server Power Off-Collection of common programming errors"},"content":{"rendered":"<p>My first post here, so apologies if anything is missing.<\/p>\n<p>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).<\/p>\n<p>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 <code>mbstat -P 0,1 1<\/code> to report the CPU usage, and it is pretty much a minute of high usage, and the server turns itself off &#8211; it doesn&#8217;t shutdown, it powers off.<\/p>\n<p>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.<\/p>\n<p>I have looked through all the logs I can find (through <code>\/var\/log<\/code> anyway) and can&#8217;t find anything of note. Not even anything in there saying that it&#8217;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.<\/p>\n<p>Ubuntu Version: 12.04.3 LTS x64 Kernel Version: 3.2.0-54-generic<\/p>\n<p>Please let me know if you require any other information. Any help that anyone could offer would be much appreciated.<\/p>\n<p>Thanks!<\/p>\n<ol>\n<li>\n<p>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&#8217;t shut down if only one CPU is used, I guess.<\/p>\n<p>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?<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-02-06 03:18:01. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2675","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2675"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2675\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}