Sometimes, we have a tendency to face high load problems on the server and that we ought to conclude that user is inflicting such problems particularly once the server is hosted with multiple domains. Here we are able to get such details victimization the commands 'ps' and 'top'. area unit able to use many various choices to type the results of those commands and a few helpful examples are provided here:
We can get the top 10 CPU consuming processes including the user details with the following command:
# ps -e -o pcpu,pid,user,args|sort -k1 -nr|head -10
To find the top 10 CPU consuming process:
# ps -auxf|sort -nr -k3|head -10
To list the top 10 Memory consuming processes with each user:
# ps -e -o pmem,pid,user,args|sort -k1 -nr|head -10
To show the process usage of a user with ‘top’ command:
# top -u $username
To get a list of top 10 CPU usage processes with username:
# watch "ps -e -o pcpu,pid,user,args|sort -k1 -nr|head -10"
To list the top 10 Memory consuming processes with username:
# watch "ps -e -o pmem,pid,user,args|sort -k1 -nr|head -10"
To check the number of connections from an IP address currently connected to the server:
# netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
- 0 Users Found This Useful