Lead Image © Sergey Nivens, 123RF.com

Lead Image © Sergey Nivens, 123RF.com

Collecting and evaluating performance data over a period of time

System Accountant

Article from ADMIN 19/2014
By
Several utilities offer a snapshot of system performance – from Top or Uptime to Iostat, Netstat, and Mpstat – but what if you only learn of a bottleneck after it has happened? Sar to the rescue.

Sar (System Activity Reporter) is an inconspicuous, small, command-line tool that originally comes from the System V world. Today, sar is indispensable for troubleshooting or tuning Unix/Linux systems. Not only does sar provide ad hoc information on many performance values, it also collects data incessantly and sorts it on a daily basis into organized binary logs.

Sar keeps seven logs by default, but it can also remember a month of events. On some operating systems, such as Ubuntu, archives reaching back even longer are possible. Thus, for each point of time in a past period, you can retrospectively determine CPU utilization or free RAM, the number of network packets transmitted, or the speed of disk I/O.

Installation

Sar is included in the repositories of all well-known Linux distributions, and the package is typically named sysstat. In addition to the binary, some scripts and cron entries need to be installed, including:

  • sar: The sar command is used to display collected values.
  • sadc: (System activity data collector) takes a predetermined number of samples at defined intervals.
  • sa1: A wrapper for sadc, the sal shell script passes various parameters to sadc and sends the returned data to the correct binary log. The logfiles usually reside in /var/log/sa or /var/log/sysstat (Ubuntu) and always go by the name sa<dd>, where dd is the day of the month. The script is usually called every 10 minutes by cron, although you can adjust the interval if you need more or fewer values.
  • sa2: This shell script rotates the daily log and compresses older logs on request. Sa2 is launched by cron once a day.
  • sadf: An output program for data exchange, sadf processes collected data in various formats
...
Use Express-Checkout link below to read the full article (PDF).

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=