In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 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 analyze pidstat. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Pidstat
Pidstat is a command of the sysstat tool that monitors the use of system resources such as CPU, memory, threads, device IO, etc., for all or specified processes. The first run of pidstat displays information from the start of the system, and then running pidstat displays statistics since the last time the command was run. Users can get the statistics they need by specifying the number and time of statistics.
Usage: pidstat [options] [[]]
Options:
[- C] [- d] [- h] [- I] [- l] [- r] [- t] [- u] [- V] [- w]
[- p {[,...] | SELF | ALL}] [- T {TASK | CHILD | ALL}]
Commonly used parameters:
-u: default parameter, which displays the usage statistics of each process
-r: displays memory usage statistics for each process
-d: displays the IO usage of each process
-p: specify the process number
-w: displays the context switch for each process
-t: displays additional information about the statistics of the thread that selected the task
-T {TASK | CHILD | ALL}: TASK means to report independent task,CHILD keyword for statistics of all threads under the reporting process, and ALL means to report all threads under independent task and task.
Note: global statistics for task and child threads are independent of the pidstat option. These statistics do not correspond to the current statistical interval and are collected only when the child thread kill or completes.
-V: version number
-h: shows all activities on one line so that other programs can easily parse
-I: in SMP environment, indicates the CPU utilization / number of cores of the task
-l: displays the command name and all parameters
View CPU usage for all processes
Pidstat and pidstat-u-p ALL are equivalent.
[root@127-0-0-1 ~] # pidstat
Linux 2.6.32-754.22.1.el6.x86_64 (10-130-10-74) 08Accord 06Universe 2020x86mm 6440 CPU)
07:57:55 PM PID usr system guest CPU CPU Command
07:57:55 PM 1 0.00 0.00 0.00 1 init
07:57:55 PM 2 0.00 0.00 0.00 1 kthreadd
07:57:55 PM 3 0.00 0.00 0.00 0 migration/0
07:57:55 PM 4 0.00 0.00 0.00 0 ksoftirqd/0
PID: process ID
% usr: percentage of CPU occupied by processes in user space
% system: percentage of CPU occupied by processes in kernel space
% guest: percentage of CPU occupied by processes in the virtual machine
% CPU: percentage of CPU occupied by the process
CPU: the CPU number of the process
Command: the command corresponding to the current process
Memory usage statistics
[root@127-0-0-1] # pidstat-r
Linux 2.6.32-754.22.1.el6.x86_64 (10-130-10-74) 08Accord 06Universe 2020x86mm 6440 CPU)
08:02:38 PM PID minflt/s majflt/s VSZ RSS MEM Command
08:02:38 PM 1 0.00 0.00 19352 1472 0.00 init
08:02:38 PM 836 0.00 0.00 215600 75416 0.06 redis-server
08:02:38 PM 1630 0.02 0.00 1601196 115652 0.09 mongod
PID: process identifier
Minflt/s: the secondary error that occurs every second of the task, without loading the page from disk
Majflt/s: the main error that occurs every second of the task. The page needs to be loaded from disk.
VSZ: virtual machine address size, virtual memory usage KB
RSS: resident collection size, memory using KB in non-swap area
Command:task command name
IO usage statistics
[root@127-0-0-1] # pidstat-d
Linux 2.6.32-754.22.1.el6.x86_64 (10-130-10-74) 08Accord 06Universe 2020x86mm 6440 CPU)
08:06:08 PM PID kB_rd/s kB_wr/s kB_ccwr/s Command
08:06:08 PM 1 37.59 186.71 1.63 init
08:06:08 PM 584 0.00 0.01 0.00 khugepaged
08:06:08 PM 836 0.00 0.00 0.00 redis-server
08:06:08 PM 1630 0.00 0.04 0.02 mongod
PID: process id
KB_rd/s: KB read from disk per second
KB_wr/s: write to disk KB per second
KB_ccwr/s: KB written to disk for task cancellation. Occurs when the task truncates the dirty pagecache.
Command name of the COMMAND:task
Process context switching
[root@127-0-0-1] # pidstat-w-p 24397
Linux 2.6.32-754.22.1.el6.x86_64 (10-130-10-74) 08Accord 06Universe 2020x86mm 6440 CPU)
08:08:11 PM PID cswch/s nvcswch/s Command
08:08:11 PM 24397 0.00 0.00 mongod
PID: process id
Cswch/s: number of active task context switches per second
Nvcswch/s: number of passive task context switches per second
Command: command name
Displays additional information in addition to the statistics of the thread that selected the task
[root@127-0-0-1] # pidstat-t-p 24397
Linux 2.6.32-754.22.1.el6.x86_64 (10-130-10-74) 08Accord 06Universe 2020x86mm 6440 CPU)
08:09:24 PM TGID TID usr system guest CPU CPU Command
08:09:24 PM 24397-0.00 0.00 0.00 30 mongod
08:09:24 PM-24397 0.00 0.00 0.00 30 | _ _ mongod
08:09:24 PM-24398 0.00 0.00 0.00 21 | _ _ signalP.gThread
08:09:24 PM-24399 0.00 0.00 0.00 2 | _ _ Backgro.kSource
TGID: identifier of the main thread
TID: thread id
% usr: percentage of cpu occupied by processes in user space
% system: percentage of cpu occupied by processes in kernel space
% guest: percentage of cpu occupied by processes in the virtual machine
% CPU: percentage of cpu occupied by the process
CPU: the cpu number of the process
Command: the command corresponding to the current process
On how to analyze pidstat to share here, I hope that 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.