Linux PS command, view a process CPU and memory usage situation, Linux PS command, view process CPU and memory occupancy rate sort. Do not specify

Source: Internet
Author: User
Tags session id time and date

Background: Sometimes you need to look at the CPU and occupancy of a process, sometimes you need to look at a single occupancy of the overall process.
I. Linux PS command to view CPU and memory usage of a process
[[email protected] vhost]# PS aux
user        pid  %cpu    %mem    vsz   RSS TTY       STAT    START   time Command
Explanation:
PS command under Linux
USER Process Run User
pid     process number
%CPU process CPU Utilization
%MEM Process memory consumption
The virtual size used by the process of the VSZ
RSS The size of the resident set used by the process or the size of the actual memory
TTY with process-associated terminal (TTY)
STAT Check Status: The process state is represented by a character, such as R (running is running or ready to run), S (sleeping Sleep), I (Idle idle) , Z (Zombie), D (non-disruptive sleep, usually I/O), P (Waiting for a Swap page), W (Swap out, indicates the current page is not in memory), N (Low priority Task) T (terminate termination), W has no resident pages
START (Process start time and date)
times; (Total CPU time used by the process)
Command (command-line command executing)
NI (Nice) Priority
PRI process priority number
PPID process ID for parent process (parent Process ID)
SID session ID)
Wchan the name of the kernel function in which the process is sleeping; the name of the function is obtained from the/root/system.map file.
FLAGS Process-related digital IDs
———————————— The output from the columns above can then be used by awk to output a specific column ————————————

View Plainprint?
    1. PS aux |grep httpprograme| awk ' {print ( $ "$" "$4" "$11");} '


View a process health parameter for a user o:

    1. Ps-o User,%cpu,%mem,command
    2. -o,o user-defined-f full--group--user--pid--cols--ppid


Excerpt from: HTTP://WWW.COMMANDLINEFU.COM/COMMANDS/VIEW/7244/MICRO-PS-AUX-BY-MEMCPU




Second, Linux PS command, view process CPU and memory occupancy rate sort
Use the following command to view:
Ps-aux | sort-k4,4n
PS Auxw--sort=rss
PS Auxw--sort=%cpu

Excerpt from: http://blog.chinaunix.net/uid-21389973-id-3292358.html

Linux PS command, view a process CPU and memory usage situation, Linux PS command, view process CPU and memory occupancy rate sort. Not specified

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.