In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use ksar tools to analyze system performance, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
System performance monitoring is an important work of Unix and Linux system administrators. If the server system performance is suddenly below average, the problem may come from the processes being executed, memory utilization, disk performance, network traffic, and CPU pressure. In today's limited IT budget, it is more important than ever to understand how to optimize system performance. Blindly investing in hardware is not an acceptable way, and sometimes it may not work. Usually system administrators use some basic tools (top, vmstat, mpstat, ps, free) to identify and deal with some performance issues. Ksar is the graphical version of Java of sar, which can reflect the system information such as cpu, memory, network, Icano and so on graphically. And support for remote monitoring of Unix-like operating systems (Linux, AIX, Solaris, HPUX).
Introduction to ksar
Usually, system administrators use a set of commands to complete the following tasks: uptime shows system load, mpstat shows CPU performance, free shows memory usage, vmstat shows virtual memory usage, iostat shows system Imax O activity, netstat shows network activity, df and du show disk usage. You can also use the sar tool to accomplish the above tasks, and sar is the abbreviation for System Activity Reporter (system activity report). This tool can collect system performance data, such as CPU utilization, hard disk and network throughput data, through the collection and analysis of these data, the system administrator can judge whether the system is running normally or not, and is a right-hand man to improve the efficiency of the system.
Install and configure ksar
Install and configure sar before using ksar, which is also included in most Linux distributions and is the sysstat package in Redhat Linux. In addition, you also need to configure Java JDK. The JDK version is not required, and the version is higher than 1.50. After the configuration is complete, you can run the following command to check the version number:
# java-version if the version number is greater than 1.50, you can use ksar # wget http://jaist.dl.sourceforge.net/project/ksar/ksar/5.0.6/ksar-5.0.6.zip # unzip ksar-5.0.6.zip # cd ksar-5.0.6/ # sh run.sh
Figure 1. * the target host should be set for each run of ksar
Use ksar to analyze disk Ibank O
At present, the overall processor speed, memory size and the execution speed of Imax O are increasing, but the throughput and delay performance of Imax O operation is still several orders of magnitude lower than that of equivalent memory access operation. In addition, because many workloads have important Icano components, Ipicuro processing can easily become an important bottleneck in overall throughput and overall application response time. For applications with intensive operations, performance analysts must use tools to obtain information about the operation of the Icano subsystem. If the system administrator wants to know the disk iScale O information, he can open the Run local command field of the data menu and enter the command: sar-b 312, which means that the disk usage is reported every 3 seconds, running a total of 12 seconds as shown in figure 2. Figure 2 shows the statistical average data at the end of data collection.
Figure 2. Use ksar to analyze disk Ibank O
Parameter description:
Ttansfer/s: the number of times per second from the physical disk. Multiple logical requests will be merged into a single disk request, and the size of a transfer is uncertain.
Read/s: number of read requests per second
Writer/s: number of write requests per second
Block bread/s: the number of blocks read from the disk per second
Block wrtn/s: the number of blocks written to disk per second
Using ksar to analyze Network Information
The ksar command uses the-n option to report network-related information, and available parameters include: DEV, EDEV, SOCK, and FULL. If the system administrator wants to know the network information, he can open the Run local command column of the data menu and enter the command: sar-n DEV 1 / 2 as shown in figure 3.
Figure 3. Using ksar to analyze Network Information
Parameter description:
Rxpck/s: number of packets received per second
Txpck/s: the number of packets sent per second
Rxbyt/s: number of bytes received per second
Txbyt/s: the number of bytes sent per second
Rxcmp/s: the number of compressed packets received per second
Txcmp/s: the number of compressed packets sent per second
Txmcst/s: the number of multicast packets received per second
Use ksar to analyze CPU information
If the system administrator wants to know the working information of the CPU, he can open the Run local command field of the data menu and enter the command: sar-P ALL results as shown in figure 4.
Figure 4. Use ksar to analyze CPU information
Parameter description:
Time spent by user running the process in user mode
% time spent by nice running the normal process
Time spent by system running processes in kernel mode (system)
The amount of time that the processor waits for iowait O to complete when no process executes on this CPU
Idle has no time for the process to execute on this CPU
Use ksar to analyze memory information
Workloads are likely to exhaust all available memory. Therefore, it is necessary to use some tools to monitor memory usage, such as the kernel memory usage of each process or thread, as well as the memory usage mechanism of kernel data structures and its amount and size. As with CPU utilization, understanding the behavior of the operating system and individual processes is critical to tracking any performance problems caused by memory shortages. If the system administrator wants to know the memory information, he can open the Run local command field of the data menu and enter the command: sar-r 1 as shown in figure 5.
Figure 5. Use ksar to analyze memory information
Parameter description:
Memfree: this value is free memory.
Memused: this value is the memory used.
% memused: this value is a percentage of the memory used and the total amount of memory used (excluding swap).
Use ksar to analyze NFS information
The network file system (Network File System,NFS) can integrate the file system of the remote machine with the local file system, that is, NFS uses the same read-write interface as the local to access data remotely. If the system administrator wants to know the NFS information, open the data menu in the Run local command column and enter the command: sar-n NFS 1 results as shown in figure 6.
Figure 6. Use ksar to analyze NFS information
Parameter description:
Call/s: every second a successful RPC call increases the value of call/s, such as a read / write to NFS.
Retrans/s: the number of RPC retransmissions per second, for example, when timeout is generated due to a problem with the server, the client needs to retransmit.
Read/s: the number of reads per second from the NFS server.
Write/s: the number of writes to the NFS server per second.
Access/s: the number of times NFS is accessed per second, such as COPY files from the NFS server.
Getatt/s: the number of times per second to get file attributes on the NFS server, such as ls-l / NFSSERVER/,. If NFSSERVER has 300 files, it will generate 300 such requests.
Use ksar to understand system interruption
To understand the use of system interrupts, the system administrator can open the Run local command section of the data menu and enter the command:: sar-I ALL 1 as shown in figure 7.
Figure 7. Use ksar to understand system interruption
Parameter description:
Intr/s represents the number of interrupts per second.
Use ksar to understand system memory paging
Paging is a memory management mechanism in the operating system. In this way, the computer can access data on other storage media for main memory. If the system administrator wants to know the system memory paging information, he can open the Run local command column of the data menu and enter the command: sar-B1 results as shown in figure 8.
Figure 8. Understand the paging of system memory
Parameter description:
Pgpgin/s: represents the number of bytes per second from disk or SWAP to memory (KB).
Pgpgout/s: represents the number of bytes per second replaced from memory to disk or SWAP (KB).
Fault/s: the number of missing pages generated by the system per second, that is, the sum of primary and secondary missing pages (major + minor).
Majflt/s: the number of primary missing pages generated per second.
Use ksar to know all the information of the system as a whole
Ksar provides an option,-A, which represents all and is capitalized, and this-An equates to all options. Open the Run local command input command of the data menu: sar-A results as shown in figure 9.
Figure 9. Use ksar to know all the information about the system
You can see from figure 8 that the system usage includes: system process, context, CPU, interrupt, Imax O system, memory usage, connection, system load, swap partition, NFS server, and client performance including all important information. In addition, you can export the results of ksar to a file (file types include pdf, PNG, JPG, TXT, CVS). You can also import a previously obtained monitoring result into ksar for graphical analysis.
Set the working period of ksar
Ksar can also view non-real-time data, which generates the data to the specified directory by running the sysstat script in the cron cycle. For example, we can select the start time period from the "Select time range" menu as shown in figure 10.
Figure 10. Select start time period
Remote use of ksar
Ksar supports SSH connections, which you can use to remotely monitor other Linux or other Unix types of hosts. The first step is to set up an automatic login between the local host and the remote host through automatic SSH, and then open the Lanuch ssh command input command of the data menu: ssh goodcjh2@192.168.110.1 as shown in figure 11.
Figure 11.ksar supports SSH connection
Ksar is a graphical tool based on sar. It can report the activities of the system from more than 10 aspects, including reading and writing of files, usage of system calls, serial port, CPU efficiency, memory usage, process activities and IPC-related activities. This command is very complex and can only be mastered through skillful use.
On how to use ksar tools to analyze system performance is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.