Top Banner
Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari
24

Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Mar 30, 2015

Download

Documents

Santos Feather
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Unix Systems Performance Tuning

Project of COSC 513

Name: Qinghui Mu

Instructor: Prof. Anvari

Page 2: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Performance Tuning

• Performance tuning is a process of observing the operations of a system and making adjustments to different components based on those observations. As a result we get an overall more efficient system.

Page 3: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

What is system performance?

• In a broader sense, system performance refers to how well the computer resources accomplish the work they are designed to do. The performance of any computer system may be defined by two criteria:

Response time

Throughput

Page 4: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Key factors

● Hardware

● Operating system

● Application software

● Users

● Changes over time

Page 5: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Managing system performance

• Monitoring usage of system resources• Selecting tools to measure system performance • Diagnosing problems from the results of

measurement• Tuning the operating system and application

parameters• Upgrading the hardware resources of the system• Planning for the optimal performance

Page 6: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Bottlenecks

• A resource is a bottleneck, if the size of a request exceeds the available resource. In other words, a bottleneck is a limitation of system performance due to the inadequacy of a hardware or software component, or of the system’s organization.

Page 7: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Two ways to solve a bottleneck

• increasing the size of available resource

• decreasing the size of the request

Page 8: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Guidelines in tuning a real system

• Never tune at random

• Tune one area at a time

• Change only one parameter at a time

• Always use at least two tools

• Experience is the best tool

• Know when to say stop

Page 9: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tuning steps

Step 1: Get current measurements

Step 2: Find current bottleneck

Step 3: Remove it

Step 4: Make new measurements

Step 5: If required performance is not achieved go to step 1

Step 6: Stop for the time being.

Page 10: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

System Resources

• CPU

• Memory

• Disks and disk controllers

• Busses

• Networking

• Operating system

Page 11: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Test Tools

• Tools for CPU Utilization

• Tools for Memory Utilization

• Tools for Disk Utilization

• Tools for Network Utilization

Page 12: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for CPU Utilization - 1

• mpstat: mpstat reports per-processor statistics in tabular form. Each row of the table represents the activity of one processor. The first table summarizes all activity since boot; each subsequent table summarizes activity for the preceding interval. All values are rates (events per second) unless otherwise noted.

Page 13: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for CPU Utilization - 2

• iostat: The iostat utility iteratively reports terminal, disk and other I/O activities, as well as CPU utilisation. The –c option of iostat is useful to report the percentage of time the CPU has spent in user mode, in system mode, waiting for I/O and idling.

Page 14: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for CPU Utilization - 3

• Sar: System Activity reports are also a good tool to see the resources utilization of a system. sar can be used to analyze all the system resources. The –u option gives the CPU utilization. Again constant high percentage under %usr column means system is CPU bound.

Page 15: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for CPU Utilization - 4

• Top: Top is a good free-ware tool available on net. This tool shows the top processes on a system using system resources. This includes total system-wide memory and CPU usage and break-up of these resources being used by every process.

Page 16: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for CPU Utilization – 5

• Use vmstat 5 to confirm the CPU bottleneck. Things to look for is procs column, which shows how many processes are running, waiting for I/O or other activity like lock or sleep. The r column includes processes that are running on the CPU. r>0 means that adding CPU power can be profitable. Where as CPU column has similar columns us sy and id and has same meaning as in system activity report (sar). If there is no idle time that means system is CPU bound.

Page 17: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Memory Utilization - 1

• vmstat: vmstat can be used to see the virtual memory usage. If there is any paging or swapping being done by the system. This is a good tool to see if a system is memory bound.

Page 18: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Memory Utilization - 2

• sar: System Activity Report can be used to see if swapping is being done by the system.  Use sar –w to see if there is any swapping going on. Some swapping and paging is normal but too many swap-in and swap-outs can be an indicator of low memory. sar –g also reports number of pages per second scanned by the paging daemon (pgscan/s). If this value is high, the page daemon is spending a lot of time checking for the free memory.

Page 19: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Memory Utilization - 3

• The best RAM shortage indicator is the scan rate (sr) output from vmastat. A scan rate of above 200 pages per second for long periods of time indicates memory shortage. Excessive paging (pi and po) is also an indicator of low memory.

Page 20: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Disk Utilization - 1

• Use iostat –x . The wait column shows the queue length, that is, the average number of transactions waiting for service. The %w column shows the percentage of time the queue is not empty; that is, the percent of time there are transactions waiting for service. If a system spends a good percentage of time for I/O, this could indicate a disk bottleneck. High %b and svc_t are also an indication of disk I/O bottleneck. Careful configuration, thatis, spreading the load across devices can improve response time.

Page 21: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Disk Utilization - 2

• vmstat

• Whenever there are blocked process, all CPU idle time is treated as wait for I/O time. If number of blocked processes; that is, the number of process under b column, exceed the number of processes in run queue, under r column. This shows disk sub-system bottleneck.

Page 22: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Network Utilization - 1

• ntop: This is a tool with the similar interface as top. It provides detailed network utilization for each computer on local network. We can write filter to see traffic for specific hosts. Detailed network traffic statistics available from this tool.

Page 23: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Tools for Network Utilization - 2

• netstat: netstat with –i option gives the incoming packets, outgoing packets, collisions and errors for each network interface on the system. So this can also be used to see the traffic being generated on the system.

Page 24: Unix Systems Performance Tuning Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari.

Viewing and setting Tuning Parameters in Solaris

• sysdef: provides a list of approximately 60 of the most commonly used tuning parameters

• adb: The kernel degugger, enables to look and alter the valuesof tuning parameters. adb and crash utility allow the inspection of the running system

ndd:  Used to look at and change the settings of network device driver and protocol stack.