240 likes | 423 Views
Unix Systems Performance Tuning. Project of COSC 513 Name: Qinghui Mu Instructor: Prof. Anvari. Performance Tuning.
E N D
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.
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
Key factors ● Hardware ● Operating system ● Application software ● Users ● Changes over time
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
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.
Two ways to solve a bottleneck • increasing the size of available resource • decreasing the size of the request
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
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.
System Resources • CPU • Memory • Disks and disk controllers • Busses • Networking • Operating system
Test Tools • Tools for CPU Utilization • Tools for Memory Utilization • Tools for Disk Utilization • Tools for Network Utilization
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.