Tuesday, July 1, 2025

DevOps Linux Troubleshooting Process Management

 


To find the top 10 CPU-consuming processes

# ps -e --sort=-pcpu -o pid,pcpu,comm 

# ps -e --sort=-pcpu -o pid,pcpu,comm | head -n <noumber>

# ps -eo pid,comm,%mem,%cpu --sort=-%cpu | head -n <number>



To find the top 10 memory-consuming processes

# ps -e --sort=-pmem -o pid,pmem,comm

# ps -e --sort=-pmem -o pid,pmem,comm | head -n <number>

# ps -eo pid,comm,%mem,%cpu --sort=-%mem | head -n <number>



To find the uptime of the process 

# ps -eo comm,lstart,etime,user 

# ps -eo comm,lstart,etime,user | grep -i <service-name>

No comments:

Post a Comment