cancel
Showing results for 
Search instead for 
Did you mean: 
jeesshnasree
Starfighter Starfighter
Starfighter
  • 14.1K Views

How to check high CPU usage on Linux Os

hi team,

 

could you please provide commands for high cpu utilzation on Linux OS.

 

how to resolve high CPU usage alerts on Linux OS .

 

could you please share your valuable information.

Labels (1)
0 Kudos
6 Replies
NunoMartins
Flight Engineer Flight Engineer
Flight Engineer
  • 14.1K Views

There are many many tools for this - most basic is just running top - I personally prefer to use nmon. Once in nmon you can select cpu and it will tell you whats what. If you looking to see more what processes are hamming the CPU then you wanna use ps - example if you wanna see the top 10 processes hitting the cpu: ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head -n 10

but  like i said there are many many tools for this. 

If you want to have something in place to trigger a notification on some kind of threshold again there are many tools but i like running zabbix with a email notification. 

0 Kudos
jeesshnasree
Starfighter Starfighter
Starfighter
  • 14.1K Views

Hi @NunoMartins , thanks for your your valuable information but actually I don’t have install tools. Actually I am getting alerts through nagios but when login and check with top , w  commands doesn’t shows like 100% thread usage. 

 

I thought its flase alarms but someone told that’s genuine alerts. But didn’t get which process ID usage . Still I didn’t fine any process ID for 100% thread CPU usage . I don’t have access for install tools . 

 

Could please provide commands for capture that 100% thread cpu usage .

 

 

0 Kudos
Crycore
Cadet
Cadet
  • 13.9K Views

Hi @jeesshnasree ,

Using top with the -H option should list all of the threads currently running in your Linux environment. From the listed threads, you can determine how much of your processing is being consumed. I hope this helps.

0 Kudos
Razique
Flight Engineer Flight Engineer
Flight Engineer
  • 13.9K Views

You can also do a

top -o cpu

To sort by CPU usage.

0 Kudos
littlebigfab
Starfighter Starfighter
Starfighter
  • 13.9K Views

Hi,

@Razique, it probably depend on top version. On my RHEL7, it's :

top -o %CPU

 

@jeesshnasree: what you describe seems to be a poorly configured Nagios monitor. It's totally normal that your CPU is used 100% when it has a non-blocking operation to make. Why wouldn't it? A more efficient monitor would watch for an extended duration of high CPU usage, that duration having to be determined based on the theoretically expected CPU usage for that server.

In a perfect world, CPU usage should always be close to 100%. If not, you're wasting your available computing power.

Razique
Flight Engineer Flight Engineer
Flight Engineer
  • 13.8K Views

Thanks for correction @littlebigfab 

0 Kudos
Join the discussion
You must log in to join this conversation.