Load average is an exponentially weighted average of the number of processes in the run queue. Strange that you&#39;re not seeing much iowait, though maybe not everything shows up there. Usually if you see high load average and low CPU it means you&#39;ve got high I/O. Watching &quot;vmstat 2&quot; usually confirms this with blocked processes on the left.<div>
<br></div><div>I&#39;m wondering if usleep works differently from sleep? Not necessarily a busy loop but it doesn&#39;t go to sleep to wait for a signal?</div><div><br></div><div>BTW if you&#39;re trying to manage jobs, something like beanstalkd might be more efficient than managing your own load, plus it&#39;s network aware.  There&#39;s a Ruby gem called Stalker that makes it really easy to run a worker daemon that runs the commands you want (bindings in just about every language out there, too) Then it&#39;s just a matter of running the number of worker instances, say one per CPU.</div>
<div><br></div><div>Sean<br><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 3:28 PM, Trevor Cordes <span dir="ltr">&lt;<a href="mailto:trevor@tecnopolis.ca">trevor@tecnopolis.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(A real question this time!)<br>
<br>
I have a web (+ other tasks) server that sometimes does a lot of tasks in<br>
a short time that spike the load up to large values (like 30).  The tasks<br>
are all long jobs of lots (tens of thousands) of little (10/s) jobs.  I&#39;ve<br>
written code to, between each little job, check the /proc/loadavg load (1<br>
and 5 min) and insert usleeps (.5+ secs) based on the loadavg (exponential<br>
relationship).  My goal is to keep the load &lt; 2.0 on a 2 core system.<br>
<br>
Anyhow, it seems to be working fine.  The weird thing is, at 2.0 loadavg,<br>
looking at top, I see the CPUs mostly at idle.  Not even very much wait<br>
going on.  Why would the load be 2 when both CPUs are mostly at 5-10%<br>
including wait?<br>
<br>
I basically want to make sure the system doesn&#39;t get overloaded and can<br>
respond to non-batch request (like a web hit) promptly.  What loadavg<br>
should I target if not (1.0 * numcores)?  I guess I can arbitrarily pick<br>
numbers and see what happens, but I like things like this to make sense,<br>
and to me 1.0 * numcores makes sense, unless I&#39;m not understanding loadavg<br>
properly.<br>
<br>
Thanks!<br>
_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Sean Walberg &lt;<a href="mailto:sean@ertw.com" target="_blank">sean@ertw.com</a>&gt;    <a href="http://ertw.com/" target="_blank">http://ertw.com/</a><br>
</div>