On 2/1/07, <b class="gmail_sendername">Ian Petersen</b> <<a href="mailto:ispeters-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">ispeters-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> That's quite helpful, thank you.  All of the machines that I run have<br>> loads under 1, and so I have little experience with this type of thing.<br><br>I believe, and someone can correct me if I'm wrong, that "maximum
<br>load" is the same as the number of CPUs in the system.  In other<br>words, if you have a uniprocessor, and the load is 1, then the CPU is<br>always busy, but you haven't overloaded the system.  In a<br>dual-processor setup, you can run with a load of 2 and it's the same
<br>as a uniprocessor running at 1--both processors are maxed, but the<br>system's not overloaded.</blockquote><div><br>Ian's quite right .. depending on the version of top that's available, you may get a lins starting with 'CPU states' for each processor, or you may just get a single line starting with 'Cpu(s):'
<br><br>A single processor machine might look like this:<br><br><span style="font-family: courier new,monospace;"> 13:52:55  up 2 days,  7:28,  7 users,  load average: 0.07, 0.06, 0.09</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">89 processes: 88 sleeping, 1 running, 0 zombie, 0 stopped</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">CPU states:   
2.8% user   0.4% system   0.0% nice   0.0% iowait  96.7% idle</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Mem:   513772k av,  504120k used,    9652k free,       0k shrd,   82244k buff
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    389064k actv,       0k in_d,   10468k in_c</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Swap: 1044184k av,   13608k used, 1030576k free                  274352k cached</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
15726 alex      20   0  1144 1144   864 R     0.9  0.2   0:00   0 top</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    1 root      15   0   480  452   424 S     0.0
  0.0   0:04   0 init</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    2 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 keventd</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    3 root      15   0     0    0     0 SW    0.0  0.0   0:01   0 kapmd</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
    4 root      34  19     0    0     0 SWN   0.0  0.0   0:00   0 ksoftirqd_CPU</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    9 root      25   0     0    0     0 SW    
0.0  0.0   0:00   0 bdflush</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    5 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kswapd</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    6 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kscand/DMA</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
...</span><br><br>and a multi-processor machine might look like this:<br><br><span style="font-family: courier new,monospace;">top - 13:53:14 up 389 days,  8:03,  1 user,  load average: 0.03, 0.01, 0.00</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Tasks: 106 total,   1 running, 105 sleeping,   0 stopped,   0 zombie</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 99.9% id,  0.0% wa,  0.0% hi,  0.0% si</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Mem:   2074712k total,  1084732k used,   989980k free,   166684k buffers
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Swap:  4194296k total,        0k used,  4194296k free,   359816k cached</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">12858 openvpn   15   0  7464 4536 1144 S  2.0  0.2  11:03.81 openvpn            </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
    1 root      16   0  1744  568  492 S  0.0  0.0   0:16.26 init               </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    2 root      RT   0     0    0    0 S  
0.0  0.0   0:15.90 migration/0        </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0        
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    4 root      RT   0     0    0    0 S  0.0  0.0   0:09.78 migration/1        </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    5 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1        </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
    6 root      RT   0     0    0    0 S  0.0  0.0   0:07.55 migration/2        </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    7 root      39  19     0    0    0 S  
0.0  0.0   0:00.00 ksoftirqd/2        </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    8 root      RT   0     0    0    0 S  0.0  0.0   0:16.08 migration/3        
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    9 root      39  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/3        </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   10 root      10  -5     0    0    0 S  0.0  0.0   0:14.95 events/0           </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
   11 root      10  -5     0    0    0 S  0.0  0.0   0:02.35 events/1           </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   12 root      10  -5     0    0    0 S  
0.0  0.0   0:01.45 events/2           </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   13 root      10  -5     0    0    0 S  0.0  0.0   0:00.44 events/3           
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   14 root      10  -5     0    0    0 S  0.0  0.0   0:00.01 khelper     <br>...<br></span><br>Note that for the multi-processor machine there are multiple event queues.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">So, assuming my understanding of the load number is correct, your web<br>servers would need to be 40-processor machines to be able to run at a
<br>load of 40 without being overloaded.  Or, turning that on its head,<br>your hosting company has apparently oversold the server by a factor of<br>10 to 40, depending on how many cores are in the machine, which is<br>unreasonable in my eyes, unless its costing you pennies.
</blockquote><div><br>Right -- it may be that it's a dual or quad machine that's just keeping busy, but my guess is that it's a single processor machine that the web provider is making plenty of money from. Try the command
<br><br>  $ cat /proc/cpuinfo<br><br>and see what it says -- it should list the available processors on the system. The first system shown above has a single 1GHz processor with 256K cache; the second one has four 2.4GHz processors, each with 512K cache. Bogomips numbers are 2005 and 4799, respectively.
<br><br></div></div>-- <br>Alex Beamish<br>Toronto, Ontario<br>aka talexb