ngungo
ngungo

Reputation: 5332

CPU idle % vs load average

I have read all related questions but have not found an adequate answer. How can both CPU idle % and load average high at the same time? What is the relation of the two measurements. Is there way to improve the load averages by make use of CPU idle? Thanks in advance.

/# top 4 10
load averages:  7.51,  7.75,  7.42;                    up 26+20:51:52  14:51:35
51 processes: 44 sleeping, 6 on cpu, 1 swapped
CPU states: 76.2% idle,  5.9% user, 17.9% kernel,  0.0% iowait,  0.0% swap
Memory: 1024M phys mem, 3267M free mem, 2048M total swap, 1519M free swap

   PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
  1101 mysql     21  59    0  133M  114M cpu/19 685:21  1.36% mysqld
 47426 www        1  28    0   43M   22M cpu/1    0:13  0.38% httpd
 47543 www        1  30    0   42M   21M cpu/13   0:11  0.37% httpd
 48459 www        1  16    0   41M   19M sleep    0:00  0.37% httpd


/# mysqladmin -uroot -ppass extended-status | grep Threads
| Threads_cached                           | 0           |
| Threads_connected                        | 9           |
| Threads_created                          | 455358      |
| Threads_running                          | 3           |
/#

EDIT a day later. According to all answers the system is unstressed but we still experience long latency from websites on the system. The latency normally sub-second now is several seconds, sometimes in teens or more. Would it be because of i/o? If it is what would your suggestions? Thanks again.

~# iostat c 1
   tty         cpu
 tin tout  us sy dt id
   0  245   4 30  0 66
   0   32   4 15  0 81
   0   24   3 18  0 79
   0   24   4 25  0 71
   0   24   3 27  0 71
   0   24   2 22  0 75
   0   24   3 21  0 77
   0   24   2 20  0 77
   0   24   4 17  0 79
   0   24   5 21  0 74
   0   24   5 15  0 80
   0   24   6 11  0 83
   0   24   8  8  0 84
   0   25   8 10  0 82
   0   24   7 12  0 81
   0   24   5 16  0 78
   0   24   4 17  0 79
   0   24   2 14  0 83
   0   24   2 13  0 84

Upvotes: 2

Views: 2560

Answers (1)

Chris Dodd
Chris Dodd

Reputation: 126536

I think you might need to revise your conception of what a 'high' load average is. Since you have something running on cpu/19, you have at least 19 CPU threads in your system -- probably 24 or 32. So to get the idle down close to 0, you'll need a load average of MORE than that. With only ~7, you'll only be able to keep at most around 1/4 of the CPU threads busy, so the other 75% will be idle.

Upvotes: 3

Related Questions