LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-18-2014, 12:28 PM   #1
occam25
LQ Newbie
 
Registered: Feb 2010
Posts: 19

Rep: Reputation: 0
uptime command shows high cpu load while atop shows cpu idle


Hi,
I am working in an embedded device using a debian based distribution.
I'm monitoring the CPU load average using uptime command and atop.
Sometimes I see the uptime 1min average going up a lot (up to 4 in a single processor board, A LOT!) but in atop (with interval 1) I don't see the huge CPU usage that the uptime command suggest (I see something like: CPU sys 7% user 4% irq 1% idle 88%)

AFAIK, the percentages shown by atop correspond to:
sys: processes in kernel space
user: processes in user space
irq: interrupts handling
idle: doing nothing

so the CPU is 88% idle but uptime suggests a huge load... Is there any kind of process in kernel that are not shown in atop? How can I trace them or how can I figure out where is the bottleneck if atop doesn't tell me who is the buggy process?

I also tried vmstat command but it didn't give me any clue..
 
Old 09-18-2014, 12:59 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,260

Rep: Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948
I've seen high load with low CPU usage in top before - in my case it's usually caused by I/O. If the drive starts lagging or pausing, the CPU usage drops since it's blocked waiting for the I/O, but the load doesn't change. So if you have four processes waiting on a hung/slow drive, CPU usage will be low while they wait, but load will be high, since all four processes are waiting on system resources.

From man uptime:
Quote:
System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk.

Last edited by suicidaleggroll; 09-18-2014 at 01:02 PM.
 
Old 09-19-2014, 03:11 AM   #3
occam25
LQ Newbie
 
Registered: Feb 2010
Posts: 19

Original Poster
Rep: Reputation: 0
thnks for reply suicidaleggroll.

When a process is waiting for I/O the kernel preempt it and gives the CPU to another process, right? so, if a process is waiting another one should get the CPU for execution. Maybe I have many processes waiting for I/O.. but then I don't know why I don't see waits (wa column) or io in vmstat output. I see mainly 0s in that columns.

Could it be that the RAM is buggy and the waits are there?


thanks!
 
Old 09-19-2014, 04:36 PM   #4
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 290

Rep: Reputation: 55
Are you using multi-tasking? Are any of these processes waiting for queues or waiting for locks that another may have set ???
 
Old 09-19-2014, 10:30 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Unfortunately that quote from the manpage is at least misleading
Quote:
System load averages is the average number of processes that are either in a runnable or uninterruptable state. A process in a runnable state is either using the CPU or waiting to use the CPU.
So far, so good.
Quote:
A process in uninterruptable state is waiting for some I/O access, eg waiting for disk
Wrong.
s/is waiting/may be waiting/

This a major difference - especially in Linux where loadavg !== CPU load. Processes can be made uninterruptable and left there for some (hopefully short) time. Two of these add 2 to the loadavg - but have NO effect on CPU%. Apache is known to do this - likewise Oracle.
Then, of course, you also have tasks waiting on I/O completition which also contribute to loadavg as mentioned. So you have to understand the workload, and what processes actually are in uninterruptable wait.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] High CPU load, but low CPU usage (high idle CPU) baffy Linux - Newbie 5 03-13-2013 10:24 AM
/proc/cpuinfo shows incorrect CPU frequency, even under load pwc101 Debian 1 07-31-2008 08:54 AM
top shows 150% cpu load crashmeister Linux - General 3 02-02-2008 09:18 AM
High load - but CPU 99% idle? Boss Hoss Linux - Hardware 6 05-24-2004 05:39 AM
High idle cpu load in 2.6.4? geekzen Linux - General 4 04-10-2004 12:54 PM


All times are GMT -5. The time now is 01:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration