High CPU utilization can result in performance issues and resource constraints on the server. The playbook helps in identifying the resource-intensive processes and help reduce their impact on the system.
mpstat -P ALL 1 5
pidstat 1 5
pidstat 1 1|awk '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ { if ($8 > 90 ) {print $NF ,\"pross taking\", $8,\"% of cpu\" }}'
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head -20|column -t
sar -u 2 10
top -b -n1 | grep 'Cpu(s)' | awk '{print $2 + $4}'
ps -eo s,user | grep '^[RDZ]' | sort | uniq -c | sort -nbr | head -20
ps -eo s,user,cmd | grep ^[RDZ] | sort | uniq -c | sort -nbr | head -20