There are many commands for monitoring the Linux system. The pidstat command is one of them. You can use the pidstat command to monitor the process data of the Linux system. However, you must first install the pidstat before you can use it. Linux installation using pidstat method, interested friends may wish to understand.
The pidstat command is used to monitor independent tasks (processes) managed by the Linux kernel. It outputs information about each task that is managed by the kernel. The pidstat command can also be used to monitor child processes for a particular process. The interval parameter is used to specify the time interval between each report. Its value of 0 (or no parameters) indicates that the time of the process's statistics is calculated from the system startup.
How to install pidstat
pidstat is part of the sysstat software suite, sysstat contains many tools to monitor system status linux, it can be obtained from most linux distributions of the software source.
On the Debian/Ubuntu system you can use the following command to install
# apt-get install sysstat
The CentOS/Fedora/RHEL version of linux uses the following Command:
# yum install sysstat
Using pidstat
Using pidstat without any arguments is equivalent to adding the -p argument, but only active tasks are displayed come out.
# pidstat
You can see the results in the following:
PID - the process being monitored task number
% usr - The cpu usage of this task when executing at the user level (application), regardless of the nice priority. Note that the cpu time calculated by this field does not include the time spent in the virtual processor.
%system - The CPU usage of this task when used at the system level.
%guest - The cpu usage (running on the virtual processor) that the task spends on the virtual machine.
%CPU - Total cpu usage of the task. In an SMP environment (multiprocessor), if you enter the -I parameter on the command line, the CPU usage is divided by the number of your CPUs.
CPU - The processor number on which this task is running.
Command - The command name for this task.
I/O Statistics
Get I/O statistics by using the -d parameter. For example:
# pidstat -d -p 8472
IO output displays the number of entries in:
kB_rd /s - the task is read from the hard disk Speed (kb)
kB_wr/s - write speed of the task to the hard disk (kb)
kB_ccwr/s - rate at which the task write disk is canceled (kb)
Page Failure and Memory Usage
Use -r to mark data that you can get memory usage.
important entries:
minflt /s - a small number of errors that occur per second when loading data from memory, these pages are not required to be loaded into memory from disk.
majflt/s - The number of large errors per second that occur when loading data from memory. These requirements are loaded from the disk into the memory page.
VSZ - Virtual Capacity: Virtual Memory Usage for the Entire Process (kb)
RSS - Long Term Memory Usage: Usage of Non-Exchangeable Physical Memory for Tasks (kb)
Example
1. You can monitor memory usage by using the following command
# pidstat -r 2 5
This will give you 5 statistics about page faults. As a result, the interval is 2 seconds. This will make it easier to locate the process in question.
2. Display all child processes of the mysql server
# pidstat -T CHILD -C mysql
3. Combine all statistics into a single report that is easy to read中:
# pidstat -urd -h
The above is the introduction of the Linux installation using pidstat. Through the introduction of this article, I believe you have a certain understanding of the usage of the system monitoring command pidstat. If you want to know more about Linux system monitoring commands, see the commands used by the system home Linux system monitoring.
Firefox is a browser that users like very much on Linux systems, but Firefox often has garbled chara
Linux file content review, you can use the command to achieve. Cat, tac, more, incl
On Linux systems, Docker is an application development platform that packages applications on Docker
Linux system regular expressions are string description methods. The main regular expressions are se
Detailed method for automatic backup and deletion of website data under Linux
Linux method of cutting txt large files into small files through shell script
How to deal with the problem of Linux system downtime
How to use clam antivirus antivirus in Linux
Ubuntu/Mint can't add a solution for PPA source
How to develop JNDI in Linux Jetty environment
Summary of zypper command usage in SUSE Linux system
How to set up Microsoft mouse in Linux system
Ubuntu uses the command to refresh the DNS cache. Step
Steps to install Brackets on Ubuntu
How does Win10 turn on audio services? How to turn on/off the audio service in Win10
Dual-core cpu is also the same. Improve the startup speed of win7 three steps to get
Win8 makes the boot speed even higher
Ubuntu tips to start the deb installation package with the dpkg command
Using Ghost to crack Microsoft's security protection
Win XP system installation comes with IPv6 protocol package
Win7 boot prompt ntoskrnl.exe file lost how to do
Introduction to methods that prevent Messenger from running: modify the registry
Solve the problem that Win7 system wireless has signal but can't connect problem.