What are the commands for monitoring the performance of Linux systems?

  
                

As a qualified Linux system administrator, it is necessary to constantly monitor the performance of the Linux system and master the real-time status of Linux. What commands should be used for Linux system performance monitoring? The following small series will give you a summary of the performance that will be used to monitor the performance of Linux systems.

I recently wrote a project operation and maintenance manual for the company. It involves performance monitoring of Linux systems.

Now learning to sell, while learning to record. The following are the commonly used commands.

top

The code is as follows:

Description: View current running status

Command format:

top [-] [d ] [p] [q] [c] [C] [S] [n]

Parameter Description:

d: Specify the time interval between each refresh of the screen information. Of course, the user can use the s interactive command to change it.

p: Monitor the status of a process by specifying the monitoring process ID.

q: This option will cause the top to refresh without any delay. If the caller has superuser privileges, then top will run with the highest possible priority.

S: Specify cumulative mode

s: Run the top command in safe mode. This will remove the potential danger of interactive commands.

i: Make top not show any idle or zombie processes.

c: Display the entire command line instead of just displaying the command name

1 : Number 1, open the detailed multi-cpu usage

u : Select the specified user process
>

Enter or Space: Refresh the record

A: Open the top view of the top

G : Select one of the top 1-4 views

In the display window of the top command, we can also enter the following letters to perform some interactions:

The help documentation is as follows:

Help for Interactive Commands - procps version 3.2.7

Window 1: Def: Cumulative mode Off. System: Delay 4.0 secs; Secure mode Off.

Z,B Global: ‘Z’ change color mappings; ‘B’ disable/enable bold

l,t,m Toggle Summaries: ‘l’ load avg; ‘t’ task/cpu stats; ‘m’ mem info

1,I Toggle SMP view: ‘1&rsquo Single/separate states; ‘I’ Irix/Solaris mode

f,o . Fields/Columns: ‘f’ add or remove; ‘o’ change display order

F or O . Select sort field

",". Move sort field: ‘"& rsquo; next col left; ‘"& rsquo; next col right

R,H . Toggle: ‘R’ normal/reverse sort; ‘H’ show threads

c,i,S . Toggle: ‘c’ cmd name/line; ‘i’ idle tasks; ‘S’ cumulative time

x,y . Toggle highlights: ‘x’ sort field; ‘y’ running tasks

z,b . Toggle: ‘z’ color/mono; ‘b’ bold/reverse (only if ‘x’ or ‘y’)

u . Show specific user only

n or # . Set maximum tasks displayed

k,r Manipulate tasks: ‘k’ kill; ‘r’ renice

d or s Set update interval

W Write configuration file< Br>

q Quit

(order shown with ‘.’ require a visible task display window )

Press ‘h’ or ‘? ’ for help with Windows,

h or? : Display the help screen and give some short command summary instructions.

k : Terminate a process. The system will prompt the user to enter the process PID that needs to be terminated and what signals need to be sent to the process. A typical termination process can use 15 signals; if it does not end normally, use signal 9 to force the process to end. The default value is signal 15. This command is blocked in safe mode.

i: Ignore idle and zombie processes. This is a switch command.

q: Exit the program.

r: Reschedule the priority of a process. The system prompts the user to enter the process PID that needs to be changed and the process priority value that needs to be set. Entering a positive value will lower the priority, otherwise it will give the process a higher priority. The default is 10.

S: Switch to cumulative mode.

s : Change the delay between refreshes. The system will prompt the user to enter a new time in s. If there is a decimal, it is converted to ms. Entering a value of 0 will continuously refresh the system. The default value is 5 s. It should be noted that if the setting is too small, it is likely to cause continuous refreshing, so that it is too late to see the display, and the system load will be greatly increased.

f or F : Add or remove items from the current display.

o or O : Change the order in which items are displayed.

l: Switch to display the average load and start time information. The first line of the display is displayed

m: Switches the display of memory information. That is, the display memory line

t : Switches the display process and CPU status information. That is, the display CPU line

c: toggles the display command name and the full command line. Display the complete command. This feature is very useful.

M : Sort by resident memory size.

P: Sort according to the percentage of CPU usage.

T: Sort by time/cumulative time.

W: Write the current settings to the ~/.toprc file. This is the recommended way to write a top configuration file.

vmstat

Description: View the overall status of the system

vmstat -n 1

df

Description: Check system disk space usage

df -h

Linux View system configuration commonly used commands

# uname -a # View kernel /operating system /CPU information # Head -n 1 /etc/issue # View operating system version

# cat /proc/cpuinfo # View CPU information# hostname # View computer name

# lspci -tv # List all PCIs Device # lsusb -tv # List all USB devices

# lsmod # List the loaded kernel modules # env # View environment variable resources

# free -m # View memory usage and exchange Area Usage # df -h # View the usage of each partition

# du -sh # View the size of the specified directory # grep MemTotal /proc/meminfo # View the total amount of memory

# grep MemFree /proc/meminfo # View free memory amount # uptime # View system running time, number of users, load

# cat /proc/loadavg # View system load magnetic And partitions # mount

Copyright © Windows knowledge All Rights Reserved