How to view the CPU, memory & Mysql resource usage for a particular user in a cPanel server from command line?
Dcpumon is a CPU/Memory accounting script which stores percentage values of CPU and Memory usage under /var/log/dcpumon. By default, a cron has been setup to run the script for every 5 minutes and by which the statistics are getting updated in WHM. This script will read all the data and log the statistics data in the folder ” /var/log/dcpumon”.
Given below is the command used to view the CPU, memory & Mysql resource usage from command line.
In order to find the usage for a particular user/account, use grep and extract the required user alone.
/usr/local/cpanel/bin/dcpumonview | grep cPanel user name
# /usr/local/cpanel/bin/dcpumonview | grep cPanel_user_name
cPanel_user_name cPanel_domain_name 3.94 0.14 0.3
Top Process %CPU 127 /usr/bin/php /home/cPanel_user_name/public_html/index.php
Top Process %CPU 91.0 /usr/bin/php /home/cPanel_user_name/public_html/index.php
Top Process %CPU 85.0 /usr/bin/php /home/cPanel_user_name/public_html/index.php