Top CPU consumers

General support questions
Post Reply
JackBauer
Posts: 47
Joined: 2020/05/19 13:56:35

Top CPU consumers

Post by JackBauer » 2021/09/27 07:57:12

Hello,

How to get the top CPU consumers?

Thanks

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Top CPU consumers

Post by MartinR » 2021/09/27 08:00:15

man top(1)

JackBauer
Posts: 47
Joined: 2020/05/19 13:56:35

Re: Top CPU consumers

Post by JackBauer » 2021/09/27 09:16:18

Yes thanks.

I see many processes consuming 60-70% then what?

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Top CPU consumers

Post by jlehtone » 2021/09/27 09:34:57

100% is one core. You probably have many. Press '1' in top. That toggles between one-line summary of CPU and all cores shown.

"Then what" ... what do you want to do now that you know the active processes?

JackBauer
Posts: 47
Joined: 2020/05/19 13:56:35

Re: Top CPU consumers

Post by JackBauer » 2021/09/27 11:09:05

The thing is that at every minute, the processes at the top change...

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: Top CPU consumers

Post by tunk » 2021/09/27 12:08:57

What process(es) and what user(s)?

JackBauer
Posts: 47
Joined: 2020/05/19 13:56:35

Re: Top CPU consumers

Post by JackBauer » 2021/09/27 12:12:56

We have many DBs and these are mysql databases and processes.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Top CPU consumers

Post by jlehtone » 2021/09/27 13:44:43

JackBauer wrote:
2021/09/27 11:09:05
The thing is that at every minute, the processes at the top change...
Yes. The top updates its view regularly.
man top wrote: The top program provides a dynamic real-time view of a running system.
...
-d :Delay-time interval as: -d ss.t (secs.tenths)
Specifies the delay between screen updates. Default: 1.5 seconds.

If you want a snapshot from one moment, then perhaps ps is better:

Code: Select all

ps axuk -%cpu | head -30
For the options: man ps

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Top CPU consumers

Post by MartinR » 2021/09/27 15:16:04

If you want a more historical view there's always sa/sar and friends. If you are hunting for it be aware though that it has been moved from cron into the potty black hole.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Top CPU consumers

Post by TrevorH » 2021/09/27 15:26:37

I can't help but think that the real question has not even been asked...
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply