# "Load Average" - FreeBSD vs. Linux --- comparable measures?



## dalecosp (Apr 12, 2012)

Hello,

At work we've got a CentOS 5 server and, since I've been here, have added a server running FreeBSD 9.

We have a fairly intensive PHP workload/website running on the CentOS box, and a couple sites on the FBSD one.  However, in terms of traffic itself, even the CentOS box isn't serving a high visitor load.

Nonetheless we've had occasions where load on the CentOS box, as reported by top(1) and/or uptime(1), has exceeded 100 (possibly even 200).  I've never seen such numbers on a FreeBSD box in the 10 years I've used the OS.

Do these numbers even mean the same thing betwixt GNU/Linux and FreeBSD?  What's your experience?

Thanks,


----------



## Rudy (Apr 20, 2012)

My experience is that load = number of things waiting in the queue for the kernel to deal with.  A load of '1' is good for a single core -- do they even exist anymore  -- and you shouldn't worry if your load is 3 on a quad core box.  You shoot for load =< total_number_of_cores.

That said a load spiraling to 100 -- regardless of OS -- means something is tanking.  For example, you have a database that worked fine, but a table has grown to a million lines and no one ever bothered to put an index on that table.  The machine is bound by disk, threads/processes start getting in line to do something disk related, and the kernel says -- wait a minute, I am full bore over here, wait a minute.  When your load is 100, you have 100 threads/processes in line to talk to the kernel - disk interface.  Of course, this is an example, but in my experience, you probably have something hosed and it is probably disk IO related on your CentOS box.

Another good example comes to mind: put a caching layer in front of your web server that generates every page uniquely thus driving htcacheclean batty as it tries to clean up files that are being generated faster than it can delete them... load 500!!!


----------



## dalecosp (Aug 12, 2014)

*Re: "Load Average" - FreeBSD vs. Linux --- comparable measur*



			
				Rudy said:
			
		

> My experience is that load = number of things waiting in the queue for the kernel to deal with.  A load of '1' is good for a single core -- do they even exist anymore  -- and you shouldn't worry if your load is 3 on a quad core box.  You shoot for load =< total_number_of_cores.
> 
> That said a load spiraling to 100 -- regardless of OS -- means something is tanking.  For example, you have a database that worked fine, but a table has grown to a million lines and no one ever bothered to put an index on that table.  The machine is bound by disk, threads/processes start getting in line to do something disk related, and the kernel says -- wait a minute, I am full bore over here, wait a minute.  When your load is 100, you have 100 threads/processes in line to talk to the kernel - disk interface.  Of course, this is an example, but in my experience, you probably have something hosed and it is probably disk IO related on your CentOS box.
> 
> Another good example comes to mind: put a caching layer in front of your web server that generates every page uniquely thus driving htcacheclean batty as it tries to clean up files that are being generated faster than it can delete them... load 500!!!



Rudy,

Thank you for taking time to answer this (albeit, two years ago)!  I don't know that I was aware that "load average" was an indicator of "kernel queue".

Over time, I've attempted to re-write portions of the "heavy" web app to run a little lighter, with moderate to good success.  I'm still somewhat mystified by the stats:  The Linux box serves about .5 to .6 requests per second, while the FreeBSD box serves about 3 requests per second, yet the "load average" on Linux is still one to two orders of magnitude larger than the FBSD "Load Average" around the clock.  The good news is that the Linux box doesn't ever hit "100" anymore due to the before-mentioned work.  Thanks again.


----------

