Rediscovering sar

By  

Monitoring system performance with sar is as easy as enabling the sar tasks. While sar is bundled into many versions of Unix, it's often disabled until you take steps to get it running. To find out whether sar is running on your Unix server, just type sar and see what happens. If you get a report that shows you performance measures for every ten minutes or so, it's collecting data for you.

# sar
Linux 2.6.18-128.el5 (boson)     07/22/2012

12:00:01 AM       CPU     %user     %nice   %system   %iowait    %steal     %idle
12:10:01 AM       all      0.15      0.00      0.06      0.01      0.00     99.78
12:20:02 AM       all      0.08      0.00      0.05      0.01      0.00     99.86
12:30:01 AM       all      0.09      0.00      0.05      0.01      0.00     99.85
12:40:01 AM       all      1.83      0.00      0.11      0.36      0.00     97.70
...
03:00:01 PM       CPU     %user     %nice   %system   %iowait    %steal     %idle
03:10:01 PM       all      0.22      0.00      0.07      0.02      0.00     99.69
03:20:01 PM       all      0.09      0.00      0.05      0.01      0.00     99.86
03:30:01 PM       all      0.10      0.00      0.05      0.01      0.00     99.84
03:40:01 PM       all      0.10      0.00      0.05      0.01      0.00     99.85
03:50:01 PM       all      0.09      0.00      0.05      0.01      0.00     99.86
04:00:01 PM       all      0.08      0.00      0.04      0.01      0.00     99.86
04:10:01 PM       all      0.10      0.00      0.05      0.01      0.00     99.84
Average:          all      0.12      0.00      0.05      0.01      0.00     99.82

Now, let's examine what these numbers are telling us. For one thing, the %idle -- a fairly obvious measure of how much of the time your CPU (or CPUs) are simply waiting for something to do -- is above 99%. This particular system is twiddling its proverbial thumbs. Scanning through the measurements, the 97.70 in the fourth line of measurements is the busiest it's been. But, of course, today is Sunday and it might have an altogether different profile on a weekday.

The other numbers tell us what is going on the rest of the time.

  • %user -- percentage of the time the CPU is performing user tasks (commands and applications)
  • %nice -- percentage of the time the CPU is performing user tasks with the priority set to "nice"
  • %system -- percentage of the time the CPU is executing kernel tasks
  • %iowait -- percentage of the time the CPU is idle with outstanding I/O requests
  • %steal -- percentage of the time the CPU spent in involuntary wait (applies to virtual CPUs)
  • %idle -- percentage of the time the CPU is idle without outstanding disk I/O reuqests

If your server is not collecting sar data routinely, you can look at current performance by giving sar some arguments.

Photo Credit: 

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness