首页  

linux pidstat 命令     所属分类 linux 浏览量 1048
pidstat 是sysstat 套件的一部分

yum install sysstat

pidstat  -druwh 2

pidstat 默认 -u  Report CPU utilization.

2秒刷新一次

#      Time   UID       PID    %usr %system  %guest    %CPU   CPU  minflt/s  majflt/s     VSZ    RSS   %MEM   kB_rd/s   kB_wr/s kB_ccwr/s   cswch/s nvcswch/s  Command
1606539245     0     15611    0.50    0.00    0.00    0.50     0      0.00      0.00 2797436 416396  22.10      0.00      0.00      0.00      0.00      0.00  java


-d     Report I/O statistics
-h     Display all activities horizontally on a single line
-l     Display the process command name and all its arguments.
-p { pid [,...] | SELF | ALL }
-r     Report page faults and memory utilization.
-u     Report CPU utilization.
-w     Report task switching activity (kernels 2.6.23 and later only)
-s     Report stack utilization.

pidstat  -druwh -p 15611  2 
-p 指定进程







kB_rd/s
Number of kilobytes the task has caused to be read from disk per second.

kB_wr/s
Number of kilobytes the task has caused, or shall cause to be written to disk per second.

kB_ccwr/s
Number of kilobytes whose writing to disk has been cancelled by the task. 
This may occur when the task truncates some dirty pagecache. 
In this case, some IO which  another  task has been accounted for will not be happening.
                     
minflt/s
Total number of minor faults the task has made per second, those which have not required loading a memory page from disk.
每秒次缺页错误次数(minor page faults),虚拟内存地址映射成物理内存地址产生的page fault次数


majflt/s
Total number of major faults the task has made per second, those which have required loading a memory page from disk.

每秒主缺页错误次数(major page faults),
当虚拟内存地址映射成物理内存地址时,相应的page在swap中,这样的page fault为major page fault,
一般在内存使用紧张时产生


VSZ
Virtual Size: The virtual memory usage of entire task in kilobytes.

RSS
Resident Set Size: The non-swapped physical memory used by the task in kilobytes.

%MEM
The tasks's currently used share of available physical memory.
                     

cswch/s
Total number of voluntary context switches the task made per second.  
A voluntary context switch occurs when a task blocks because it requires a resource that is unavailable.

nvcswch/s
Total number of non voluntary context switches the task made per second.  
A involuntary context switch takes place 
when a task executes for the duration of its  time  slice  
and then is forced to relinquish the processor.
                     
                                        
StkSize
The amount of memory in kilobytes reserved for the task as stack, but not necessarily used.

StkRef
The amount of memory in kilobytes used as stack, referenced by the task.

%usr
Percentage  of  CPU  used  by the task while executing at the user level (application), 
with or without nice priority. Note that this field does NOT include time spent running a virtual processor.

%system
Percentage of CPU used by the task while executing at the system level (kernel).

%guest
Percentage of CPU spent by the task in virtual machine (running a virtual processor).

%CPU
Total percentage of CPU time used by the task.

上一篇     下一篇
传说中的阿里味儿

Linux资源监控命令

Linux查找磁盘IO读写很高的进程

linux load 简介

linux watch 命令

linux sar 使用简介