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 “top –c” 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.
top --c
cd /proc/<process id> ls -l
The above command will give the link to the directory from which the script is running. Also try installing suphp in the server.
There are various ways to checkout the processes using high percentage of CPU and RAM, like
1) WHM >> Apache Status : it will show you each request to your website + it’s CPU and RAM usage.
2) ps -auxf : it will list all the current processes running on the server + it’s CPU and RAM usage
3) top c : same as above but shows a real time view of all the processes and resource usage
Load monitoring commands
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.
2) If say a user is listed high in the above command with higher resource usage the command
ls -alh /proc/<id> |grep cwd
Where
3) Check WHM interfaces
Main >> Server Status >> Daily Process Log
Main >> Server Status >> Apache Status
Some of the security tips that will help you is :-
1) enable suPHP
2) enable mod_security
3) also close some of the security holes in the php functions using the php disable_functions.
is there any command to show the Users with CPU and Memory usages ?
Use top -c d2 -u “username” as an example top -c d2 -u mylogwp