Linux Performance monitoring and optimization

Source: Internet
Author: User
Tags cpu usage

Top command

Command function

The top command can dynamically view the overall operation of the system in real time, and is a comprehensive multi-party information

Practical tools for monitoring system performance and operational information.

Command syntax

Top (option)

Option description

-B: Operation in batch mode;

-D: Screen refresh interval time.



Uptime

Command function

The uptime command is capable of printing how long the system has been running and the average load on the system.

Command syntax

Uptime (option)

Option description

-V: Displays version information for the instruction.



Free command

Command function

The free command displays the number of unused and used memory in the current system, and displays the

The memory buffers used by the kernel.

Command syntax

Free (option)

Option description

-B: Displays memory usage in bytes;

-K: Displays memory usage in kilobytes;

-M: Displays memory usage in megabytes;

-O: Do not display buffer adjustment columns;

-s〈 interval seconds: Continuous observation of memory usage;

-T: Displays the sum of memory columns;

-V: Displays version information.



Iostat command

Command function

The Iostat command is used to monitor system input and CPU usage.

Command syntax

Iostat (option) (parameter)

Option description

-C: Show only CPU usage;

-D; Show only device utilization;

-K: Display state in kilobytes per second instead of block per second;

-M: Display status in megabytes per second;

-P: Displays only the state of the block device and all other partitions that are used;

-T: Displays the time when each report was generated;

-V: Displays the version number and launches;

-X: Displays the extended state.

Parameter description

Interval time: The interval between each report (in seconds);

Displays the number of reports.



Mpstat command

Command function

The mpstat command instruction is primarily used in multi-CPU environments, and it shows the status of each available CPU.

Command syntax

Mpstat (option) (parameter)

Option description

-P: Specifies the CPU number.

Parameter description

Interval time: The interval between each report (in seconds);

Number of times: the number of times the report is displayed.



SAR command

Command function

The SAR command is a Linux system running State Statistics tool that will specify the operating system status counter

Display to standard output devices.

Command syntax

SAR (option) (parameter)

Option description

-A: Displays all report information;

-B: Show i/0 rate;

-B: Displays the status of the page change;

-C: Show process creation activity;

-D: Displays the status of each block device;

-E: Sets the end time of the display report;

-F: Extracting reports from specified files;

-I: Set the time interval for state information refresh;

-P: Reports the status of each CPU;

-R: Show memory status;

-U: Displays CPU utilization;

-V: Displays the status of index nodes, files, and other kernel tables;

-W: Displays the swap partition status;

-X: Displays the status of the given process.

Parameter description

Interval time: The interval between each report (in seconds);

Number of times: the number of times the report is displayed.



Vmstat command

Command function

The meaning of the Vmstat command is to display the virtual memory state (viryual Memor Statics), but

Is that it can report on processes, memory, i/0 and other system overall operational status.

Command syntax

Vmstat (option) (parameter)

Option description

-A: Displays the active memory;

-F: Shows the total number of processes created after startup;

-M: Display slab information;

-N: Header information is displayed only once;

-S; Displays event counters and memory status in tabular format;

-D: report disk status;

-P: Displays the specified hard disk partition status;

-S: The unit of output information.

Parameter description

Event interval: time interval for state information refresh;

Number of times: the number of times the report is displayed.


Time command

Command function

The time command is used to count the total times spent on a given instruction run.

Command syntax

Time (parameter)

Parameter description

directive: Specifies the amount of instruction and its parameters that need to be run.



Tload command

Command function

The TLOACL command graphically outputs the average load of the current system to the specified terminal.

Command syntax

Tload (option) (majority)

Option description

-s Specifies the scale at leisure;

-d Specifies the time (in seconds) for the interval.

Parameter description

terminal Specifies the device file that displays the information.

Development qixoo.com

lsof command

Command function

The lsof command is used to display a list of all files that are currently open on the Linux system.

Command syntax

Lsof (option)

Option description

-C: Displays a list of files opened with instructions that begin with the specified character.



Fuser command

Command function

The Fuser command is used to report the files and network sockets used by the process.

Command syntax

Fuser (option) (parameter)

Option description

-A: Displays all files specified on the command line;

-K: Kills all processes that access the specified file;

-I: Users are required to confirm before killing process;

-I: Lists all known signal names;

-M: Specifies a loaded file system or a loaded block device;

-N: Choose a different namespace;

-U: Displays the user name to which it belongs after each process number.

Parameter description

File: Can be a file name or TCP, UDP port number.

Linux Performance monitoring and optimization

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.