<br>
<b>Warning</b>:  Undefined array key "HTTP_REFERER" in <b>/home/webhostingchenna/domains/webhostingchennai.co.in/public_html/blog/wp-content/plugins/wp-linkbuilder/plugin/plugin_class.inc.php</b> on line <b>637</b><br>
{"id":743,"date":"2018-02-26T16:22:39","date_gmt":"2018-02-26T10:52:39","guid":{"rendered":"http:\/\/www.webhostingchennai.co.in\/blog\/?p=743"},"modified":"2019-03-12T13:12:56","modified_gmt":"2019-03-12T07:42:56","slug":"how-find-resource-usages-of-users","status":"publish","type":"post","link":"https:\/\/www.webhostingchennai.co.in\/blog\/how-find-resource-usages-of-users\/","title":{"rendered":"How do I find resource usages of users in Centos"},"content":{"rendered":"<h4><span style="">How to find resource usages of users in Centos <\/span><\/h4>\n<p>In some high load situations, we need to find out the resource consumption of each user in the server to figure out the exact issue. There are a lot of options\/commands to find the same. Normally, we are using the \u201cps\u201d and \u201ctop\u201d command for performing this.<\/p>\n</p><p>Separating or sorting Unix user with their own resource usage is quit hard with a <a href="">Linux beginner<\/a>. \u00a0The command PS has a lot of switches for sorting processes in different manner.<\/p>\n<p>We can simply sort the current executing processes with its CPU and Memory conception ratio. Also, here is a simple link\u00a0for monitoring your server load \u201cLoad monitoring in Linux servers\u201c<\/p>\n</p><p><a href=""><img data-recalc-dims=""><\/a><\/p>\n<p>\u201cps command\u201d and \u201ctop command\u201d have a lot of options, here I am explaining some useful command combinations to find the resource(cpu, memory\u2026) usages of users in the server.<\/p>\n</p><p>It\u2019s simply a static output of current resource usage in the server. You can use the grep command to separate users.<\/p>\n</p><p><strong>To list top 10 CPU usage processes with user<\/strong><\/p>\n<pre># ps -e -o pcpu,pid,user,args|sort -k1 -nr|head -10\r\n\r\n\r\n<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>[root@webhostingchennai ~]# ps -e -o pcpu,pid,user,args|sort -k1 -nr|head -10\r\n%CPU   PID    USER     COMMAND\r\n 0.0     9    root     [rcu_sched]\r\n 0.0  9202    vnstat   \/usr\/sbin\/vnstatd -n\r\n 0.0     8    root     [rcu_bh]\r\n 0.0  8907    root     [kworker\/u4:2]\r\n 0.0     7    root     [migration\/0]\r\n 0.0   749    postfix  qmgr -l -t unix -u\r\n 0.0   746    root     \/usr\/libexec\/postfix\/master -w\r\n 0.0    68    root     [deferwq]\r\n 0.0     5    root     [kworker\/0:0H]\r\n[root@webhostingchennai ~]#\r\n<\/pre>\n<p><strong>Find out top 10 CPU consuming process<\/strong><\/p>\n<pre># ps -auxf|sort -nr -k3|head -10<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>[root@webhostingchennai ~]# ps -auxf|sort -nr -k3|head -10\r\nvnstat    9202  0.0  0.0   7444   848 ?        Ss   Feb19   0:48 \/usr\/sbin\/vnstatd -n\r\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\r\nroot         9  0.0  0.0      0     0 ?        S    Feb19   3:56  \\_ [rcu_sched]\r\nroot      8907  0.0  0.0      0     0 ?        S    Feb19   0:00  \\_ [kworker\/u4:2]\r\nroot         8  0.0  0.0      0     0 ?        S    Feb19   0:00  \\_ [rcu_bh]\r\nroot       746  0.0  0.2  89036  2172 ?        Ss   Feb19   0:04 \/usr\/libexec\/postfix\/master -w\r\nroot         7  0.0  0.0      0     0 ?        S    Feb19   0:00  \\_ [migration\/0]\r\nroot        68  0.0  0.0      0     0 ?        S&lt;   Feb19   0:00  \\_ [deferwq]\r\nroot         5  0.0  0.0      0     0 ?        S&lt;   Feb19   0:00  \\_ [kworker\/0:0H]\r\nroot       494  0.0  0.0 110036   844 tty1     Ss+  Feb19   0:00 \/sbin\/agetty --noclear tty1 linux\r\n[root@webhostingchennai ~]#<\/pre>\n<p><strong>To list top 10 Memory consuming processes with user<\/strong><\/p>\n<pre># ps -e -o pmem,pid,user,args|sort -k1 -nr|head -10<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>[root@webhostingchennai ~]# ps -e -o pmem,pid,user,args|sort -k1 -nr|head -10\r\n 1.6   450 root     \/usr\/bin\/python -Es \/usr\/sbin\/tuned -l -P\r\n 1.3 19168 root     \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.8   457 polkitd  \/usr\/lib\/polkit-1\/polkitd --no-debug\r\n 0.7 23926 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.7 23925 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.7 23924 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.7 23424 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.7 23388 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.7 23387 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n 0.7 23386 apache   \/usr\/sbin\/httpd -DFOREGROUND\r\n[root@webhostingchennai ~]#\r\n<\/pre>\n<p><strong>Find out the top 10 memory consuming process<\/strong><\/p>\n<pre># ps -auxf|sort -nr -k4|head -10<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>[root@webhostingchennai ~]# ps -auxf|sort -nr -k4|head -10\r\nroot       450  0.0  1.6 553152 16436 ?        Ssl  Feb19   2:12 \/usr\/bin\/python -Es \/usr\/sbin\/tuned -l -P\r\nroot     19168  0.0  1.3 330364 13248 ?        Ss   Feb19   1:01 \/usr\/sbin\/httpd -DFOREGROUND\r\npolkitd    457  0.0  0.8 528308  8844 ?        Ssl  Feb19   0:00 \/usr\/lib\/polkit-1\/polkitd --no-debug\r\napache   23926  0.0  0.7 330364  7784 ?        S    Feb26   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\napache   23925  0.0  0.7 330364  7784 ?        S    Feb26   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\napache   23924  0.0  0.7 330364  7788 ?        S    Feb26   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\napache   23424  0.0  0.7 330364  7772 ?        S    Feb25   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\napache   23388  0.0  0.7 330364  7788 ?        S    Feb25   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\napache   23387  0.0  0.7 330364  7788 ?        S    Feb25   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\napache   23386  0.0  0.7 330364  7768 ?        S    Feb25   0:00  \\_ \/usr\/sbin\/httpd -DFOREGROUND\r\n[root@webhostingchennai ~]#\r\n<\/pre>\n<p><strong>Find out every process running under a user<\/strong><\/p>\n<pre># ps -U user-name -u user-name u<\/pre>\n<p>Or<\/p>\n</p><pre># ps -e -o pid,user,args|grep $username<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>[root@webhostingchennai ~]# ps -e -o pid,user,args|grep root\r\n    1 root     \/usr\/lib\/systemd\/systemd --switched-root --system --deserialize 21\r\n    2 root     [kthreadd]\r\n    3 root     [ksoftirqd\/0]\r\n    5 root     [kworker\/0:0H]\r\n    7 root     [migration\/0]\r\n    8 root     [rcu_bh]\r\n    9 root     [rcu_sched]\r\n   10 root     [watchdog\/0]\r\n   11 root     [watchdog\/1]\r\n   12 root     [migration\/1]\r\n   13 root     [ksoftirqd\/1]\r\n   15 root     [kworker\/1:0H]\r\n   17 root     [kdevtmpfs]\r\n   18 root     [netns]\r\n<\/pre>\n<p>To get a dynamic result you must use the \u2018top\u2018 command instead of \u2018ps\u2019 or use the \u2018watch\u2018 command along with the \u2018ps\u2019.<\/p>\n</p><p><strong>To show the process usage of a user with \u2018top\u2019<\/strong><\/p>\n<pre># top -u $username<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>top - 11:47:03 up 7 days, 23:53,  2 users,  load average: 0.00, 0.01, 0.05\r\nTasks:  76 total,   2 running,  74 sleeping,   0 stopped,   0 zombie\r\n%Cpu(s):  0.0 us,  0.2 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st\r\nKiB Mem :  1012436 total,   370668 free,    68052 used,   573716 buff\/cache\r\nKiB Swap:  2097148 total,  2097148 free,        0 used.   906684 avail Mem\r\n\r\n  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND\r\n23384 apache    20   0  330364   7768   1936 S   0.0  0.8   0:00.00 httpd\r\n23385 apache    20   0  330364   7788   1932 S   0.0  0.8   0:00.00 httpd\r\n23386 apache    20   0  330364   7768   1936 S   0.0  0.8   0:00.00 httpd\r\n23387 apache    20   0  330364   7788   1932 S   0.0  0.8   0:00.00 httpd\r\n23388 apache    20   0  330364   7788   1936 S   0.0  0.8   0:00.00 httpd\r\n23424 apache    20   0  330364   7772   1936 S   0.0  0.8   0:00.00 httpd\r\n23924 apache    20   0  330364   7788   1936 S   0.0  0.8   0:00.00 httpd\r\n23925 apache    20   0  330364   7784   1932 S   0.0  0.8   0:00.00 httpd\r\n23926 apache    20   0  330364   7784   1932 S   0.0  0.8   0:00.00 httpd\r\n<\/pre>\n<p>You can refer this \u201cHow to show process usage for single user with TOP command\u201d for more details<\/p>\n</p><p><strong>To list top 10 CPU usage processes with user<\/strong><\/p>\n<pre># watch \"ps -e -o pcpu,pid,user,args|sort -k1 -nr|head -10\"<\/pre>\n<p><span style=""><strong>Output<\/strong><\/span><\/p>\n<pre>0.4 24497 root     watch ps -e -o pcpu,pid,user,args|sort -k1 -nr|head -10\r\n%CPU   PID USER     COMMAND\r\n 0.0     9 root     [rcu_sched]\r\n 0.0  9202 vnstat   \/usr\/sbin\/vnstatd -n\r\n 0.0     8 root     [rcu_bh]\r\n 0.0  8907 root     [kworker\/u4:2]\r\n 0.0     7 root     [migration\/0]\r\n 0.0   749 postfix  qmgr -l -t unix -u\r\n 0.0   746 root     \/usr\/libexec\/postfix\/master -w\r\n 0.0    68 root     [deferwq]\r\n<\/pre>\n<p><strong>To list top 10 Memory consuming processes with user<\/strong><\/p>\n<pre># watch \"ps -e -o pmem,pid,user,args|sort -k1 -nr|head -10\"<\/pre>\n<p>instead you can use the grep command to separate users.<\/p>\n</p><p>To disable SELinux : <a href="">Click Here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":934,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12,20],"tags":[91,92],"class_list":["post-743","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-vps","tag-finding-high-resource-users","tag-finding-resource-usage"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2018\/02\/resource.jpg?fit=640%2C260&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9NOHH-bZ","jetpack-related-posts":[{"id":1198,"url":"https:\/\/www.webhostingchennai.co.in\/blog\/how-to-check-memory-usage\/","url_meta":{"origin":743,"position":0},"title":"How to check memory usage on CentOS Server","author":"Cavin","date":"February 23, 2019","format":false,"excerpt":"How to check memory usage on CentOS Server Linux operating system comes with many commands to check memory usage. The \u201cfree\u201d command usually displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The \u201ctop\u201d command\u2026","rel":"","context":"In &quot;LINUX&quot;","block_context":{"text":"LINUX","link":"https:\/\/www.webhostingchennai.co.in\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/02\/memory.jpg?fit=640%2C260&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/02\/memory.jpg?fit=640%2C260&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/02\/memory.jpg?fit=640%2C260&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2014,"url":"https:\/\/www.webhostingchennai.co.in\/blog\/what-is-cloudlinux-and-its-uses\/","url_meta":{"origin":743,"position":1},"title":"What is CloudLinux and uses of CloudLinux in servers?","author":"Cavin","date":"September 8, 2024","format":false,"excerpt":"Introduction CloudLinux is an\u00a0operating system\u00a0that creates a secure and stable platform for\u00a0shared hosting. This cloud-computing platform based on CentOS offers a more robust and secure environment for shared hosting providers. With Cloud Linux, users gain increased control over the allocation of server resources.\u00a0This article explains what Cloud Linux is and\u2026","rel":"","context":"In &quot;CloudLinux&quot;","block_context":{"text":"CloudLinux","link":"https:\/\/www.webhostingchennai.co.in\/blog\/category\/cloudlinux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1719,"url":"https:\/\/www.webhostingchennai.co.in\/blog\/how-to-check-your-server-resource-usage-in-cpanel\/","url_meta":{"origin":743,"position":2},"title":"How to Check Your Server Resource Usage in cPanel","author":"Cavin","date":"December 25, 2023","format":false,"excerpt":"\u00a0 \u00a0 When managing your account, you will need to learn how to view your CPU usage in cPanel. Knowing this information will help you understand how your server is performing so you can make changes if necessary. This ensures that your online presence is running smoothly at all times.\u2026","rel":"","context":"In &quot;VPS&quot;","block_context":{"text":"VPS","link":"https:\/\/www.webhostingchennai.co.in\/blog\/category\/vps\/"},"img":{"alt_text":"main page","src":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2023\/12\/images-3.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1191,"url":"https:\/\/www.webhostingchennai.co.in\/blog\/4-useful-command-line-tools-to-monitor-mysql-performance-in-linux\/","url_meta":{"origin":743,"position":3},"title":"4 Useful command line tools to monitor MySQL performance in Linux","author":"Cavin","date":"February 11, 2019","format":false,"excerpt":"4 Useful command line tools to monitor MySQL performance in Linux There are many tools to monitor MySQL performance and troubleshoot a server, but in some cases they don\u2019t always perfect match for a MySQL developer or administrator\u2019s for their common needs, or may not work in some criteria, such\u2026","rel":"","context":"In &quot;MySQL&quot;","block_context":{"text":"MySQL","link":"https:\/\/www.webhostingchennai.co.in\/blog\/category\/mysql\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/02\/mysql1.jpg?fit=640%2C260&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/02\/mysql1.jpg?fit=640%2C260&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2019\/02\/mysql1.jpg?fit=640%2C260&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1604,"url":"https:\/\/www.webhostingchennai.co.in\/blog\/top-50-linux-commands\/","url_meta":{"origin":743,"position":4},"title":"Top 50 Linux Commands","author":"Cavin","date":"September 22, 2021","format":false,"excerpt":"Top 50 Linux Commands you must know as a regular user Here, let us see the top 50 linux commands, used on regular basis ls \u2013 The most frequently used command in Linux to list directories pwd \u2013 Print working directory command in Linux cd \u2013 Linux command to navigate\u2026","rel":"","context":"In &quot;CentOS \/ REDHAT&quot;","block_context":{"text":"CentOS \/ REDHAT","link":"https:\/\/www.webhostingchennai.co.in\/blog\/category\/linux\/centos-redhat\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2021\/09\/50-commands.jpg?fit=640%2C260&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2021\/09\/50-commands.jpg?fit=640%2C260&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2021\/09\/50-commands.jpg?fit=640%2C260&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":801,"url":"https:\/\/www.webhostingchennai.co.in\/blog\/installing-monitorix-on-centos-7\/","url_meta":{"origin":743,"position":5},"title":"Installing Monitorix on CentOS 7 (Step by Step guide)","author":"Cavin","date":"April 25, 2018","format":false,"excerpt":"How to install Monitorix on CentOS 7 Installing Monitorix on CentOS 7 Monitorix is an open source, lightweight service monitoring tool for Linux operating systems. It has been created to be used under production environment and can be used on embedded devices as well. Monitorix comprised of two programs: \u201cmonitorix\u201c,\u2026","rel":"","context":"In &quot;MONITORING TOOLS&quot;","block_context":{"text":"MONITORING TOOLS","link":"https:\/\/www.webhostingchennai.co.in\/blog\/category\/monitoring-tools\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2018\/04\/Monitrix.jpg?fit=660%2C260&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2018\/04\/Monitrix.jpg?fit=660%2C260&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.webhostingchennai.co.in\/blog\/wp-content\/uploads\/2018\/04\/Monitrix.jpg?fit=660%2C260&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/posts\/743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/comments?post=743"}],"version-history":[{"count":8,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"predecessor-version":[{"id":1179,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/posts\/743\/revisions\/1179"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/media\/934"}],"wp:attachment":[{"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhostingchennai.co.in\/blog\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}</p></a></p></pre></strong></p></pre></strong></span></p></pre></strong></p></pre></strong></span></p></pre></strong></p></pre></strong></span></p></pre></pre></strong></p></pre></strong></span></p></pre></strong></p></pre></strong></span></p></pre></strong></p></pre></strong></span></p></pre></strong></p></pre></strong></span></p></pre></strong></p></a></p></a></p></span></h4>