... Playbook #1

High CPU Utilization of Server(%)

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.

Checking Each CPU usages for 5 sec
                              
mpstat -P ALL 1 5
                              
                            
Checking Process Consuming High CPU
                              
pidstat 1 5
                              
                            
Checking process consuming high CPU by pidstat for interval of 5 sec
                              
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\" }}'
                              
                            
More Details Of Process
                              
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head -20|column -t
                              
                            
CPU utilization of last 5 minutes for the affected host
                              
sar -u 2 10
                              
                            
Get core based utilization details
                              
top -b -n1 | grep 'Cpu(s)' | awk '{print $2 + $4}'
                              
                            
Identify user running rpocesses in state R, D and Z
                              
ps -eo s,user | grep '^[RDZ]' | sort | uniq -c | sort -nbr | head -20
                              
                            
Identify user/commands running rpocesses in state R, D and Z
                              
ps -eo s,user,cmd | grep ^[RDZ] | sort | uniq -c | sort -nbr | head -20