In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
One of the things that backends are most afraid of is the sudden surge in server load, which may mean that eye-catching Call is coming soon. Encounter this kind of situation how to do, everyone's first reaction must be to log on to the server, first hit a top command to see Load Average bar.
Load Average
Many people say that the Load Average indicator can show that the system load is high, this sentence is true. So where exactly is the pressure? How are these three values calculated? Maybe a lot of people can't tell at once.
Let's start with the definition: the sum of the processes that CPU is working on and waiting for CPU to process over a period of time. The three numbers represent the statistics of 1 minute, 5 minutes and 15 minutes, respectively.
Therefore, this number does reflect the load of the server. However, this high number does not directly mean that there is a problem with the performance of the machine. It could be because of CPU-intensive calculations in progress, or it could be that the running queue is blocked because of the Icano problem. Therefore, when we see this number soaring, we still have to analyze the specific problems. It is simple and rude to upgrade the machine directly, but it is a temporary cure rather than a permanent cure.
Top commands one line at a time
The top command outputs a lot of parameters, and we need to look at the real server load by combining other parameters.
First line:
Top-20:41:08 up 18 days, 5:24, 2 users, load average: 0.04,0.03,0.05 top: current time up: how long the machine has been running users: how many users are there at present load average: last 1 minute, 5 minutes, 15 minutes load respectively
Sure enough, the three values that need to be paid attention to are load average. As we all know, a CPU can only run one process in a time slice, and the number of CPU cores directly affects the number of processes that the machine can run at the same time. So generally speaking, there is no problem if the value of Load Average does not exceed the total number of cores of this machine.
The second line:
Tasks: 216 total, 1 running, 215 sleeping, 0 stopped, 0 zombie Tasks: how many processes are there currently running: running processes sleeping: dormant processes stopped: stopped processes zombie: zombie processes
The more running, the more natural pressure on the server.
The third line:
% Cpu (s): 0.2 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si 0.0 st us: utilization of user processes in CPU sy: utilization of system processes in CPU ni: user process space changed priority id: idle CPU occupancy wa: percentage of CPU time waiting for input and output hi: hardware interrupt request si: software interrupt request st: steal time
This line represents the use of CPU, and us has been too high for a long time, indicating that user processes take up a lot of CPU time. If the us+sy exceeds 80 or 90 for a long time, it may mean that the performance of CPU is insufficient and needs to be added with CPU.
Line 4 & Line 5
KiB Mem: 65810456 total, 30324416 free, 9862224 used, 25623816 buff/cache KiB Swap: 7999484 total, 7999484 free, 0 used. 54807988 avail Mem total: total memory free: free memory used: buffer/cache used: write cache / read cache
The fourth and fifth lines are memory information and swap information, respectively. All programs run in memory, so memory performance is very important to the server. But when there is less free in memory, we don't need to be too nervous. What you really need to see is the used information in Swap. A Swap partition is a swap area provided by a hard disk. When there is not enough physical memory, the operating system will put temporarily unused data into the Swap. So when this value becomes higher, it means that there is really not enough memory.
The fifth line goes down
PID USER PR NI VIRT RES SHR S% CPU% MEM TIME+ COMMAND 19868 root 20 0 19.733g 369980 15180 S 0.7 0.6 129:53.91 java 19682 root 20 0 19.859g 5.766g 22252 S 0.3 9.2 139:42.81 java 54625 100 20 0 50868 33512 4104 S 0.3 0.1 0:04.68 fluentd PID: process id USER: process owner PR: priority. The higher the value, the higher the priority NI: nice value, negative value indicates high priority, positive value indicates low priority VIRT: total virtual memory used by the process SWAP: size swapped out in the virtual memory used by the process RES: physical memory size used by the process that has not been swapped out SHR: shared memory size SHR: shared memory size S: process status. D stands for uninterruptible sleep; R for running; S for sleep; T for tracking / stopping; and Z for zombie processes. % CPU: percentage of CPU usage since the last update;% MEM: percentage of physical memory used by the process; total CPU time used by the TIME+: process (in 100 seconds); COMMAND: command name / command line
This is the process information, from which you can see an overview of which processes take up system resources.
Top is, of course, our most common command to check the health of the system. There are many other orders. Vmstat,w,uptime, iostat these are commonly used commands.
The above is the editor for you to share that you understand top, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
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.