{"id":127,"date":"2014-03-06T17:47:47","date_gmt":"2014-03-06T17:47:47","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=127"},"modified":"2014-03-06T17:47:47","modified_gmt":"2014-03-06T17:47:47","slug":"how-can-i-know-which-account-is-usinig-a-lot-of-cpu-or-ram-in-my-server","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/03\/06\/how-can-i-know-which-account-is-usinig-a-lot-of-cpu-or-ram-in-my-server\/","title":{"rendered":"How can i know which account is usinig a lot of cpu or ram in my server?"},"content":{"rendered":"<p>For cPanel<\/p>\n<p>Main >> System Health >> Show Current CPU Usage<br \/>\nIt will show what user is taking most cpu. However, if you suPHP is not installed on your server, you will not able to see username. It will show you just nobody user.<\/p>\n<p>remote ssh<\/p>\n<p>Use &#8220;top &#8211;c&#8221; and nice top to find out the process that is causing high load on the server. Get the process id and then check who owns the process running in the server. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ntop --c\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncd \/proc\/&lt;process id&gt;\nls -l \n<\/pre>\n<p>The above command will give the link to the directory from which the script is running. Also try installing suphp in the server.<\/p>\n<p>There are various ways to checkout the processes using high percentage of CPU and RAM, like<\/p>\n<p>1) WHM >> Apache Status : it will show you each request to your website + it&#8217;s CPU and RAM usage.<br \/>\n2) ps -auxf : it will list all the current processes running on the server + it&#8217;s CPU and RAM usage<br \/>\n3) top c : same as above but shows a real time view of all the processes and resource usage<\/p>\n<p>Load monitoring commands<\/p>\n<p>1)top -c you will see the resource usage in percentage like Memory, CPU etc.Also server load details. And pstree -pua command list the processes in the server.<br \/>\n2) If say a user is listed high in the above command with higher resource usage the command<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nls -alh \/proc\/&lt;id&gt; |grep cwd\n<\/pre>\n<p>Where <id> is the process id of the user. This command gives the working directory of the script.<br \/>\n3) Check WHM interfaces<br \/>\nMain >> Server Status >> Daily Process Log<br \/>\nMain >> Server Status >> Apache Status<\/p>\n<p>Some of the security tips that will help you is :-<\/p>\n<p>1) enable suPHP<br \/>\n2) enable mod_security<br \/>\n3) also close some of the security holes in the php functions using the php disable_functions.<\/p>\n<p>is there any command to show the Users with CPU and Memory usages ?<br \/>\nUse top -c d2 -u &#8220;username&#8221; as an example top -c d2 -u mylogwp<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For cPanel Main >> System Health >> Show Current CPU Usage It will show what user is taking most cpu. However, if you suPHP is not installed on your server, you will not able to see username. It will show you just nobody user. remote ssh Use &#8220;top &#8211;c&#8221; and nice top to find out &#8230; <a title=\"How can i know which account is usinig a lot of cpu or ram in my server?\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/03\/06\/how-can-i-know-which-account-is-usinig-a-lot-of-cpu-or-ram-in-my-server\/\" aria-label=\"Read more about How can i know which account is usinig a lot of cpu or ram in my server?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[115],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-top"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}