Linux monitoring and management common commands

Source: Internet
Author: User

need to monitor Linux Server System performance? Try these tools built in or attached to the system below. Most Linux distributions are equipped with a large number of monitoring tools. These tools provide metrics that can be used to obtain relevant information and system activities. You can use these tools to discover possible causes of performance problems.

#1: Top- Process Activity

as a well- knownLinuxtools thatTopare most of the classesUnixoperating System Task Manager. It can display a list of processes that are currently running, and users can sort the list by different criteria. It mainly shows that the system processCPUand the memory usage status. Topyou can quickly check which processes are suspending your system. You can be inhereSeeTopexamples of use. you can enter it in the terminalTopto run it and enter into interactive mode:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/13/wKiom1b2dMWgVQBJAAGQEclujgM293.jpg "title=" 2016-03-26_165811.jpg "alt=" Wkiom1b2dmwgvqbjaagqeclujgm293.jpg "/>

Syntax: Top [Bciqss][d < interval seconds >][n < number of executions ;]

Parameters:
buse batch processing mode.
Cwhen a program is listed, the complete instructions for each program are displayed, including information about the instruction name, path, and parameters.
d<Interval of seconds>SetTopthe interval between monitoring the execution of a program, measured in seconds.
IExecutionTopinstruction, ignore idle or have becomeZombiethe program.
n<Number of executions>sets the number of updates to monitor information.
Qcontinuously monitor the status of program execution.
suse the privacy model to eliminate potential crises in interactive mode.
Susing the cumulative mode, the effect is similarPSdirective of"-S"Parameters

#2: PS- Show Process

PS command to display a snapshot of the currently running process. PS is a command to report the execution of a program, you can match Kill The instruction is interrupted at any time, removing unnecessary programs.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7E/0F/wKioL1b2c_iSuhAYAACcMU4vO6g511.jpg "title=" 2016-03-26_163445.jpg "style=" Float:none; "alt=" wkiol1b2c_isuhayaaccmu4vo6g511.jpg "/>

Parameters
-A displays all the programs executed under all terminals, except for the stage job leader.  

-u< User identification Code > the effect of this parameter and the specified "-U" parameters are the same.  

L information about the place of the column.

x Show All Programs, do not differentiate by terminal.  

a displays all programs under the current terminal, including other users ' programs.

Common Combinations :p s Aux, Ps–ef, Ps–efh,ps–eo,axo,

View processes running with the Vivek user name

# ps-u vivek-u Vivek U

Setting Custom output formats

# Ps-eopid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
# PS Axo Stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
# Ps-eopid,tt,user,fname,tmout,f,wchan

Show only the LIGHTTPD process ID

# ps-c Lighttpd-o pid=

Or

#pgrep lighttpd

Or

# pgrep-u Vivek PHP-CGI

Show process name with PID 55977

# ps-p 55977-o comm=

Identify the top 10 processes that consume the most memory

# PS-AUXF | Sort-nr-k 4 | Head-10

Find the top 10 processes with the most CPU

# PS-AUXF | Sort-nr-k 3 | Head-10

#3: Htop

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7E/13/wKiom1b2dCiSBjlNAAFXwRQeafw171.gif "title=" Htop.gif "style=" Float:none; "alt=" Wkiom1b2dcisbjlnaafxwrqeafw171.gif "/>

Parameters:

- D # : Specify the delay interval;

- u UserName : Displays only the process of the specified user;

- s Colume : Sort by the specified field;

Sub-command:

L : Displays a list of files opened by the selected process;

s : Tracks system calls for the selected process;

T : Displays the status of each process in a hierarchical relationship;

a : Binds the selected process to a specified CPU Core;

#4: Dstat Command

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7E/0F/wKioL1b2dAugDAhkAADUYPk0KKQ228.png "title=" 114315rxbokn33osmooh8k.png "style=" Float:none; "alt=" Wkiol1b2daugdahkaaduypk0kkq228.png "/>

Common parameters:

- C , --cpu : Displays CPU relevant information;

-C #,#,..., Total

-D,--disk : Displays information about the disk

-D sda,sdb,..., Tobal

- G : Displays page correlated rate data;

- M : Memory the relevant statistical data

- N : Interface relevant statistical data;

- P : Displays Process relevant statistical data;

- R : Displays io The relevant statistical data of the request;

- S : Displays swapped relevant statistical data; --tcp

--udp

--raw

--socket--IPC--top-cpu : Displays the most occupied CPU the process;

--top-io : Most occupied io the process;

--top-mem : The most memory-intensive process;

--top-lantency : the most deferred process; Kill command: -Terminate a process used to send signals to a process for management of the process, and displays the current system available signals:

#5: vmstat– Virtual Memory Statistics

is virtual memory I/O linux solaris freebsd

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/13/wKiom1b2c3bAYCgJAAC3H67sEK0768.png "style=" float: none; "title=" 114317hllnn2ll9eqgeplu.png "alt=" Wkiom1b2c3baycgjaac3h67sek0768.png "/>



Linux monitoring and management common commands

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.