UNIX Load Averages Explained

If you’ve spent much time working in a UNIX environment you’ve probably seen the load averages more than a few times.

load averages: 2.43, 2.96, 3.41

I have to admit that even in my sysadmin days I didn’t fully understand what these numbers were, but Zach did some digging a while ago to try to understand where these numbers are comming from.

In his blog entry from late last year, Zach sums it up quite nicely:

In short it is the average sum of the number of processes waiting in the run-queue plus the number currently executing over 1, 5, and 15 minute time periods.

The formula is a bit more complicated than that, but this serves well as a functional definition. Zach provides a bit more detail in his article and also points out Dr. Neil Gunther’s article on the topic which has as much depth on the topic as anyone could ever ask.

So what does this mean about your system?

Well, for a quick example let’s consider the output below. The load average of a system can typically be found by running top or uptime and users typically don’t need any special privileges for these commands.

load averages: 2.43, 2.96, 3.41

Here we see the one minute load average is 2.43, five minute is 2.96, and fifteen minute load average is 3.41.

Here are some conclusions we can draw from this.

  • On average, over the past one minute there have been 2.43 processes running or waiting for a resource
  • Overall the load is on a down-trend since the average number of processes running or waiting in the past minute (2.43) is lower than the average running or waiting over the past 5 minutes (2.96) and 15 minutes (3.41)
  • This system is busy, but we cannot conclude how busy solely from load averages.

It is important here to mention that the load average does not take into account the number of processes. Another critical detail is that processes could be waiting for any number of things including CPU, disk, or network.

So what we do know is that a system that has a load average significantly higher than the number of CPUs is probably pretty busy, or bogged down by some bottleneck. Conversely a system which has a load average significantly lower than the number of CPUs is probably doing just fine.

Easy Linux CommandsFor more tips like this check out my book Easy Linux Commands, only $19.95 from Rampant TechPress.

UNIX, systems administration, sysadmin, solaris, linux, load averages, system monitoring, sun, mac, osx

Changing Video Settings on SunBlade 100

To change the display resolution or refresh rate on a SunBlade 100 or similar Sun hardware isn’t as easy as it sounds. Or at least it’s not obvious. These directions are for an M64 type graphics accelerator. The steps are similar for other Sun graphics accelerators, but the command will be different (maybe ffbconfig). Check your hardware documentation for details.

These coommands should be run as root. I recommend running these commands via ssh from another system. If you accidentally change the resolution to something that is not supported you won’t be able to see so well to change it back.

To change video settings you’ll first want to find out what the card and display are capable of.

m64config -res ?

This will print the resolution and refresh rate options you have. Where three numbers are listed this represents the horizontal and vertical resolution and refresh rate respectively.

The current configuration will be shown with a [3] next to it. Write down the current resolution and refresh rate. There are a lot to choose from and you’ll want to know you can get back to one that works.

Configurations marked with a [2] are not supported by the video card and will probably not work.

To change the settings run this command with the desired resolution/refresh rate. The now forces the system to change these settings immediately rather than at next refresh.

m64config -res 1024x768x75 now

Your monitor should click and flicker and with luck will then come back at the new resolution. If it doesn’t you can change it back to the old settings by running the m64config command with the orignal settings. You did write the old setting down like I told you to right?

solaris, sun, unix, system administration, sysadmin

Getting Hardware Information in Solaris

Here’s a quick way to find out what hardware is installed in your Solaris system, including RAM, CPUs, PCI cards, and external devices. The output will usually include the size of each memory chip in the system.

The one trick to using this command is to make sure you use the backtick instead of a single quote around the uname -i. The backtick is typically shift tilde and forces the command between the backticks to be executed and substituted in to that part of the command.

/usr/platform/`uname -i`/sbin/prtdiag

prtdiag actually displays system diagnostic information. I’ve used this on Solaris 7 through 10. The best parts is you do not even need to be root to execute this.

For more info on prtdiag check out the man page.

solaris, sun, unix, system administration, sysadmin

Oracle Prefers Solaris 10

It looks like Oracle is re-aligning themselves with Sun Solaris as their preferred 64-bit platform. In the March issue of Oracle Magazine they have a short announcement on the topic:

Oracle has chosen the Solaris 10, Sun Microsystems’ multiplatform, open source operating system, as its preferred development and deployment platform for most 64-bit architectures. Solaris 10 will be used throughout Oracle’s development organization, and Oracle will release and ship 64-bit versions of all Oracle products on Solaris prior to, or simultaneously with, release on other operating systems.

Check out the whole article here or sign up to get your free copy of Oracle Magazine.

Thanks to Jon G. for sending this on to me.

oracle, database, database administration, dba, systems administration, sysadmin, solaris, sun, sun microsystems, UNIX, open source, 64-bit

Search UNIX without the junk

If you have done much UNIX systems administration you have probably seen output like this from the ‘find’ command:

$ find / -name lifeaftercoffee.com
find: /proc/tty/driver: Permission denied
find: /proc/sys/kernel/pax: Permission denied
find: /proc/net: Permission denied
find: /proc/4680/fd: Permission denied
find: /usr/local/dh/apache/logs/basic-argon/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-bongo/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-cabo/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-dap/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-adamant/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-emu/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-fritz/fastcgi: Permission denied
find: /usr/local/dh/apache/logs/basic-grog/fastcgi: Permission denied
…

Annoying, to say the least, that your actual search results may be buried in pages upon pages of this.

Here’s a quick way around this. Redirect the error output to /dev/null (the black hole of data.) It’s as simple as appending ‘2>/dev/null’ to the end of the command.

$ find ./ -name lifeaftercoffee.com 2>/dev/null
/home/jonemmons/logs/lifeaftercoffee.com
/home/jonemmons/lifeaftercoffee.com

Any errors are ignored, which can complicate troubleshooting, but if things aren’t doing what you want them to, just drop the redirect and run the command to see the errors again.

The command may vary depending on your shell and breed of UNIX, but this has always worked for me.

Easy Linux CommandsFor more tips like this check out my book Easy Linux Commands, only $19.95 from Rampant TechPress.

Technorati tags: , , , ,