Chapter 14 Study Guide

From ITCwiki
Revision as of 01:45, 11 April 2012 by Powe0122 (talk | contribs)
Jump to navigation Jump to search

Linux Performance

Monitor system performance using command-line included in the sysstat package. To make it easier to identify performance problems, a network administrator should run performance utilities on healthy Linux systems to develop a baseline. Performance Problems: Software Hardware Combination of the two

Software Problems

Software that requires too many system resources may use CPU, memory, and peripheral devices creating poor performance. Too many processes running or rouge processes

Hardware Problems

Improperly configured hardware (May still Work) Old ( Most companies retire computer equipment after two to five years of use) Jabbering: Sending large amounts of information to the CPU when not in use.

Resolutions

Software problems can sometimes be resolved by changing hardware. Move or Remove the software Upgrading or adding another CPU Use bus mastering peripheral components (Devices that can perform processes normally performed by the CPU) Adding RAM to increase system speed Replace slower disk drives with faster ones Use disk striping RAID Keep CD and DVD drives on a separate hard disk controller

Monitoring Performance with sysstat Utilities

Using information from the /proc directory and system devices, the System Statistics (sysstat) package contains utilities that monitor the system. To install the latest version of sysstat on a Linux system, use the following method: 1. yum install sysstat

Three of the System Statistics (sysstat) package performance monitoring utilities include:

  • mpstat (multiple processor statistics) command
  • iostat (input/output statistics)
  • sar (system activity reported) command

mpstat (multiple processor statistics)

Used to monitor CPU performance for all processors on the system since the system was started or rebooted.

To monitor a single cpu use the –P option followed by the processor number.

Example: mpstat –P 0 would display the first processor on the system. Limited in abilities

Examining the Output of the mpstat command

%user= % of time the processor spent executing user programs and daemons %nice= % of time the processor spent executing programs and daemons that had nondefault nice values %sys= % of time the processor spent maintaining itself %iowait= % of time the CPU was idle when an outstanding disk I/O request existed. %irq= % of time the CPU is using to respond to normal interrupts that span multiple CPUs. %soft= % of time the CPU is using to respond to normal interrupts that span multiple CPUs %steal= % of time the CPU is waiting to respond to virtual CPU requests %guest= % of time the CPU is executing another virtual CPU %idle= % of time the CPU did not spend executing tasks. Should be greater than 25% over a long period of time.

iostat (input/output statistics)

Measusres the flow of information to and from disk devices. Displays CPU statistics similar to mpstat Limited in abilities Adds transfers per second (tps) and block

sar (system activity reporter)

Displays more information than the mpstat or iostat command Displays CPU statistics by default Most widely used performance monitoring tool on UNIX and Linux systems Scheduled using the cron daemon to run every 10 minutes for the current day

logged to a file in the /var/log/sa directory called sa#. The # represents the day of the month

Only one month of records is kept but can be changed by editing the cron table located at /etc/cron.d/sysstat Can display different statistics by specifying options sar (system activity reporter) Displays more information than the mpstat or iostat command Displays CPU statistics by default Most widely used performance monitoring tool on UNIX and Linux systems Scheduled using the cron daemon to run every 10 minutes for the current day

logged to a file in the /var/log/sa directory called sa#. The # represents the day of the month

Only one month of records is kept but can be changed by editing the cron table located at /etc/cron.d/sysstat Can display different statistics by specifying options

Common options with the sar caommand

CPU Usage of ALL CPUs (sar -u) Default CPU Usage of Individual CPU or Core (sar -P) Memory Free and Used (sar -r) Display swapping statistics (sar -W) Reports run queue and load average (sar -q) sar -u 1 3 Displays real time CPU usage every 1 second for 3 times.

Other Performance Monitoring Utilities

top utility (discussed in Chapter 9) free command can be used to display the total amounts of physical and swap memory (in Kilobytes) and their utilizations. vmstat command indicates more information than the free command to indicate whether more physical memory is required.