How to check which process is using up the most disk resources
iotop -Use the “input output top” command to investigate which process is doing the most IO in real time.
#iotop
Total DISK READ: 0.00 B/s | Total DISK WRITE: 15.57 K/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
946 be/3 root 0.00 B/s 3.89 K/s 0.00 % 0.07 % [jbd2/dm-4-8]
27526 be/4 root 0.00 B/s 3.89 K/s 0.00 % 0.00 % rotatelogs /opt/www/logs/webserver/apache/access_log-%Y-%m-%d-%H 86400
27527 be/4 root 0.00 B/s 3.89 K/s 0.00 % 0.00 % rotatelogs /opt/www/logs/webserver/apache/mod_jk.log-%Y-%m-%d-%H 86400
Capture OS level data to show CPU and Memory usage Thread wise
#top -b -n 1 -H
Or for a specific Process
#top -b -n 1 -H <Process_PID>
Top 10 CPU consuming Process
#ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
Comparison of CPU utilization
# sar -u 5 10 ( 5 sec of interval & 10 times )