1828584 Members
2655 Online
109982 Solutions
New Discussion

CPU usage = 100%!!

 
Hobby16
New Member

CPU usage = 100%!!

I have a Linux server which is much slower since sometimes
A 'top' command gives this:
CPU states: 68,7% user, 30,8% system, 0,0% nice, 0,3% idle

The % user is too much, usually it's rather 0%! In the details of 'top', I
can't see no task which can take that much resource.
Does somebody knows what happens or how to pinpoint the faulty task.
Many thanks by advance.
9 REPLIES 9
Mark Grant
Honored Contributor

Re: CPU usage = 100%!!

My favourite one is to do "ps -ef | more" and look for the process that has a high (more than around 50) in the column headed "C".

Never preceed any demonstration with anything more predictive than "watch this"
Sergejs Svitnevs
Honored Contributor

Re: CPU usage = 100%!!

The top shows as many processes as will fit on the screen with a delay of 5 sec. Try to start top ignoring any idle processes
"top -i -S" ,
then decrease the delay beteen updates (using interractive command ) to 1.

Regards,
Sergejs
Hobby16
New Member

Re: CPU usage = 100%!!

ps -ef |more gives a C column with everything near 0
top -i -S with 1 second refresh gives 4 tasks, the hungriest beeing ... 'top' (4%.
and always ~70% user !!!
hair pulling, isn't it?
Mark Grant
Honored Contributor

Re: CPU usage = 100%!!

Then you need to get more information. I would suggest running "vmstat 1" and "iostat 1" and then possible looking at everything with "sar". This might give you a lot more to go on.

As you say. I don't think your system should be doing this.
Never preceed any demonstration with anything more predictive than "watch this"
Hobby16
New Member

Re: CPU usage = 100%!!

vmstat gives this
procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id
2 0 0 75424 1824 3828 18432 2 1 36 43 82 49 71 29 0

iostat gives this
cpu-moy: %user %nice %sys %iowait %idle
70,59 0,43 28,75 0,00 0,24

Device: tps Blk_lus/s Blk_écrits/s Blk_lus Blk_écrits
dev3-0 6,96 72,55 85,22 30029698 35274992

With iostat & vmstat, I have more info yeah, but I don't know what to think.

sar shows something that might be 'sadc' (a stat service running permanently). Killed 'sadc', but changed nothing
dirk dierickx
Honored Contributor

Re: CPU usage = 100%!!

try this command:

ps aux|sort -r -b -n -k 3|head

process taking the most cpu should be listed first.
Hobby16
New Member

Re: CPU usage = 100%!!

yep,
but same result as 'top' and the hungriest task just takes 3%!
Mark Grant
Honored Contributor

Re: CPU usage = 100%!!

Ok then, you need to start looking at drivers that you are using. Anything that is being run by the kernel without a separate process id BUT also switches into user mode a lot. Don't knwo how you're going to find one of those!

Considered upgrading to a more recent kernel?
Never preceed any demonstration with anything more predictive than "watch this"
Hobby16
New Member

Re: CPU usage = 100%!!

Much pausible indeed. I suspect the ADSL USB modem driver. Gonna have a look.