[O & M personnel? Why? 01] 20 built-in monitoring tools for Linux: top

Source: Internet
Author: User
[O & M personnel? Why? 01] 20 built-in monitoring tools in Linux: is the top person in O & M? Slave 32? Leo? Why does the male reading Qi Shi Jie (shu? /O, CPU, memory, network and other bottlenecks, so the system O & M, can not sleep? The following tools are helpful for refreshing your mind ~ (@ ^ _ ^ @)~... [O & M personnel? Why? 01] 20 built-in monitoring tools in Linux: is the top person in O & M? Slave 32? Leo? Why does the male reading Qi Shi Jie (shu? /O, CPU, memory, network and other bottlenecks, so the system O & M, can not sleep? The following tools are helpful for refreshing your mind ~ (@ ^ _ ^ @)~ (1) if top is written in front, here Rocky wants to clarify one point, and the best practices of top are as follows: "find the process that consumes the most CPU resources", Press [P], force the static output in the order of CPU usage is different from the ps, the working status of the top continuous monitoring process, default the refresh frequency is 5 times/s, but the option [-d] can be modified. The top default value is CPU usage (% CPU) sort by [M], sort by memory (% MEM), restore by [P], exit by [q] top output results can be divided into two parts: resource usage of the entire system and resource usage of each process. First, let's look at the output case in the upper part: [plain] top-00:09:57 up, 2 users, load average: 0.06, 0.17, 0.12 Tasks: 153 total, 2 running, 150 sleeping, 0 stopped, 1 zombie Cpu (s ): 1.2% us, 1.2% sy, 0.1% ni, 96.6% id, 0.8% wa, 0.0% hi, 0.0% si, 0.1% st Mem: 1998848 k total, 825504 k used, 1173344 k free, 77180 k buffers Swap: 0 k total, 0 k used, 0 k free, 421704 k cached ① first line [top] display content: ● Current time: 00: 09: 57 ● time elapsed since the startup: ● number of users logged on to the system: 2 ● The average usage load of the system every 1, 5, and 15 minutes. The smaller the load, the more idle the system is. if the value is greater than 1, pay attention to the content displayed in the second line [Tasks: currently, the total number of programs and each program in the Shenma status (running, sleeping, stopped, zombie) should be noted that zombie, if not 0, then pay attention to the use of "ps-lef | Grep defunct "find out the zombie process. some zombie processes even if kill-9 is still ignoring it and occupy the pitfalls. [plain] [root @ Rocky ~] # Ps-lef | grep defunct 1 Z root 8519 8487 0 78 0-0 exit Mar28? 00:00:00 [Xsession] 0 R root 17710 8875 0 78 0-1282-00:00:00 pts/1 grep defunct The zombie process is completely cleared using the following method: abort kill-18 PPID (ppid is its parent process, where it is 8487) # tell the parent process that its child is dead, and reclaim the allocated resources # if not, check that zookeeper killed zombie's parent process at. However, before that, you must kill zombie's brother. kill-15 PID1 PID2 and then, "kill-9 PPID" ③ line 3 [Cpu (s)] displays the overall CPU load: pay special attention to [% wa], which represents I/O wait. Generally, your machine slows down I/O is its main contributor. In addition, if it is a multi-core instance, change the CPU according to [1 ]. (4) pay attention to the usage of Swap, the smaller the better, then let's look at the output case in the lower half: [plain] pid user pr ni virt res shr s % CPU % mem time + COMMAND 470 root 15 0 53820 10 m 5720 S 3.9 0.5. 10 Xorg 1 root 15 0 2176 652 S 556 0.0. 12 init 2 root RT-5 0 0 0 S 0.0 0: 00. 00 migration/0 3 root 34 19 0 0 0 S 0.0 0: 00. 01 ksoftirqd/0 4 root RT-5 0 0 0 S 0.0 0.0. 00 watchdog/0 5 root 10-5 0 0 0 S 0.0 0: 00. 04 events/0 6 root 12-5 0 0 0 S 0.0 0: 00. 00 khelper ① PID: id of each process ② USER: USER of each process ③ abbreviation of PR: priority, priority of the process, the smaller the better ④ NI: short for nice, ⑤ % CPU: CPU usage ⑥ % MEM: memory usage 7time TIME +: total CPU usage TIME The following describes some common usage I update top every 2 seconds: top-d 2 Ⅱ outputs top twice and redirects the result to/tmp/top.txt: top-B-n 2>/tmp/top.txt III to specify the top output of a process: top-p PID
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.