Solaris performance optimization experience summary

  

In the maintenance of Solaris, there are often problems in system performance maintenance, there are many factors affecting system performance, we will average the system load, process monitoring, CPU, I /O and memory management, network traffic diagnosis and other aspects were analyzed and explained, and some methods and experiences on Solaris performance maintenance were given. The performance of the system refers to the situation in which the system completes the task, its effectiveness, stability and response rate. System administrators often complain about poor system performance, instability, slow system response, etc. All of these problems are just superficial phenomena. The performance of the entire network system is closely related to the network topology, server system, routing equipment, routing policy, access equipment, physical lines, etc. Any problem in one link will affect the performance of the entire system. . Before optimizing the performance of the entire system, it is necessary to monitor and audit whether the system resources in each link are reasonably used and allocated. The performance of a server and workstation system depends mainly on how well it is used and allocated. It is important to monitor and audit the performance of the system on a regular basis, and you should know which resources to monitor. System resources include three aspects: --- -1, CPU; ---- 2, memory subsystem; ----3, I /O subsystem. These three aspects, regardless of the existence of problems will have an impact on system performance, and audit system performance is also from these three aspects. There are many tools for auditing system performance. There are a variety of tools for auditing the running of system resources in Solaris operating system
, including: The uptime and sar commands, which are used to report the average load of the system; Ps command, which provides information about running processes in the system; The df command, which provides information about disk usage; The vmstat, iostat and sar commands, reports system activity, provides information about memory usage, and I/O system information , CPU activity, etc.; The swap command, used to count the swap usage in the system; The netstat command, used to display information about network performance. It is worth noting that for server/workstation systems, due to the increasing number of users, the use and allocation of system resources may be reasonable for a period of time. After a period of time, system resources may be in an overloaded state, so system performance Management is a long-term task, and system performance management should be used as part of the day-to-day system management to maintain reliable and efficient operation of the system. Before optimizing the performance of the system, you must know the system's hardware resource configuration, the use of software resources and the entire system configuration. The discovery of these problems is often based on the impression that the system gives people. For example, the system responds slowly to users, and the process takes more time to run. If these phenomena are discovered, the system's main resource data should be collected and analyzed to find ways to improve system performance.

Standard Tools for System Performance Analysis: CPU: vmstat sar ps Memory: vmstat ps Disk: iostat vmstat Network: netstat nfsstat Performance Tuning General Steps Note: This should be the general standard: the main purpose of performance tuning It is to enable the system to make effective use of various resources, but what is the standard for measuring the utilization of system resources, and there is no strict definition for different systems and applications. Generally, the following conditions are used to determine the use of major resources:

Good or bad CPU: user% + sys%< 70% user% + sys%= 85% user% + sys% >=90% Disk: iowait % < 30% iowait % =40% iowait % > ;= 50% Memory: No Page In & Page Out Per CPU with 10 Page/s More Page In & Page Out Network: < 30% Bandwidth Use the following steps to discover key resources that affect overall performance for performance optimization. Add or upgrade a hardware device if necessary. 1. Use iostat, sar to detect whether it is a CPU Cause 2. Use vmstat, svmon to detect whether it is a memory cause 3. Use filemon, iostat to detect whether it is a hard disk Cause 4. Use netstat or nfsstat to detect whether it is a network cause

First, the average load system of the system The average load (Last mimute, Last 5 minutes, Last 15 minutes) in different time is a convenient and common method for evaluating whether the system is overloaded. In the case of normal operation of the system, the range of 3 values ​​should be 0-2. For the Solaris operating system, you can use the following commands to get the average system load (take the host solarisEXP as an example):

----1. uptime solarisEXP% uptime 2:06 afternoon running 1 day 5:27, 7 users, average load: 0.00, 0.01, 0.01 ----2, sar (system activity reporter) The command itself can be used to collect system activity data or extract system activity data from daily activity files created by sadc. solarisEXP% sar –q (take data from file) 00:00:01 runq-sz %runocc swpq-sz %swpocc 01:00:01 1.0 0 02:00:01 1.8 0 03:00:01 1.3 0 04 :00:01 1.8 0 05:00:01 2.0 0 Average 1.6 0

----or use: “sar –options tn ”From the current, in t seconds (t>=5 ) N times of system activity data is collected during the time interval. ----runq-sz Normally it should be less than 2. If this value is continuously greater than 2, the system may be in a CPU-bound state. If %runocc is greater than 90 and runq-sz is greater than 2, the CPU is overloaded and the system response rate drops. Example: sar -u display item meaning (check CPU usage) %usr cpu time to execute user process %sys cpu time to execute system process %wio cpu time to complete I/O time %idel cpu idle time display result Analysis shows that the values ​​of %usr and %sys are basically equal in general. In a typical multi-user system, the value of %idel is usually greater than 40%. If %wio is often > 15% means that the hard disk may have a bottleneck if %idel is often less than 30% means that the processing power of the processor is weak. If %idel is often less than 10%, it indicates that the processor is heavily burdened or there is an escape process. If %idel is close to 0, and %sys is much higher than %usr, it may be that the memory shortage causes a lot of swaping and paging sar -p to check if there are more waiting processes in the system. Sar -p : Check if there is any in the system. Excessive Waiting Process This command has four related fields: runq-sz: the number of processes that can be run in memory (%): the probability of the process entering memory waiting swpq-sz: waiting for the swap (swap) Number of processes %swpocc: The probability of the process entering the swap wait shows the result summary as follows: 1) If runq-sz is often greater than 2 and %runocc is often greater than 90%, meaning the processor is overloaded 2) If %swpocc is not 0, Indicates that the system has replaced the process. You can reduce swap and paging by increasing memory or reducing buffering.

Copyright © Windows knowledge All Rights Reserved