[Linux Performance Testing Tool] PIDSTAT, linuxpidstat

Source: Internet
Author: User

[Linux Performance Testing Tool] PIDSTAT, linuxpidstat

 

PIDSTAT

NAME

Pidstat statistics on linux tasks

Syntax

Pidstat [-C comm] [-d] [-h] [-I] [-l] [-p {pid [,...] | SELF | ALL}] [-r] [-t] [-T {TASK | CHILD | ALL}] [-u] [-V] [-w] [interval [count]

Description

The pidstat command is used to monitor independent tasks managed by the Linux kernel. Each task that outputs the-p parameter or-p ALL outputs ALL tasks managed by the Linux kernel. If no parameter is set, the default value is-p ALL, but only the active tasks will appear in the report.

The Pidstat command can be used to monitor the sub-processes of the selected task. For details, see the-T option.

The Interval parameter specifies the Interval of each report. If the value is 0, the statistics after the system is started are reported. The Cout parameter indicates the number of reports generated. If the count parameter is not specified for interval, it will be generated all the time.

You can specify the activity by specifying options. If not specified, only the actual cpu activity is available.

Option

-C comm

Only tasks that contain the comm string are displayed.

-D

The report IO statistics show the following information:

PID: Process id

KB_rd/s: KB read from the disk per second

KB_wr/s: KB written to the disk per second

KB_ccwr/s: KB of the disk to which the task is canceled. This happens when the task truncates dirty pagecache.

COMMAND: Task Command name

-H

All activities are displayed on one line, so that other programs can easily Parse them.

-I

In the SMP environment, it indicates the CPU usage/number of kernels of the task.

-L

Display command names and all parameters

-P {pid [,...] | SELF | ALL}

Select a task (process) to report statistics. Pid is the process identifier. The SELF keyword indicates that pidstat reports its own process, if it is ALL, reporting ALL tasks in the system.

-R

Report errors and memory utilization. When a task is reported, it is shown as follows:

PID:Process identifier

Minflt/s:Secondary errors that occur for tasks per second. You do not need to load pages from the disk.

Majflt/s: The main error that occurs every second in the task. You need to load the page from the disk.

VSZ: Virtual address size. The size of the virtual memory is KB.

RSS: Resident set size, non-swap zone five-mile memory used KB

Command: Task Command name

When global statistics of all tasks and all threads are displayed, the following values are displayed:

PID: Process identifier

Minflt-nr: Secondary errors of all tasks and subthreads within the interval time.

Majflt-nr: Major errors of all tasks and subthreads within the interval time.

Command: Command name

-T

Displays additional information except the statistical information of the thread of the selected task:

TGID: Main thread Representation

TID: Thread id

-T {TASK | CHILD | ALL}

This option specifies the pidstat monitoring. TASK indicates the report of Independent tasks, and the CHILD keyword indicates statistics of all threads in the report process. ALL indicates reporting independent tasks and ALL threads under tasks.

Note: The Global statistics of tasks and subthreads are irrelevant to the pidstat option. These statistics do not correspond to the current statistical interval. These statistics are collected only when the sub-thread is killed or completed.

-U

Report CPU usage

The independent process of the report is shown as follows:

PID: Process id

% Usr: User-level cpu usage

% System: System-level cpu usage

% Guest: Cpu usage of the virtual processor

% CPU: Total CPU usage

CPU: Number of CPUs used by the process.

Command: Command name

When reporting tasks and global statistics for all threads:

PID: Process id

Usr-ms: The number of milliseconds used by tasks and subthreads at the user level.

System-ms: The number of milliseconds used by tasks and subthreads at the system level.

Guest-ms: The number of milliseconds in which tasks and subthreads are used in a virtual Machine (running a virtual processor.

Command: Command name

-V

Output version number.

-W

Report context switching activity:

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

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.