Thursday 26 December 2013

common linux performance monitoring tools

 common linux performance monitoring tools

besides the 'top' command which is the top useful command in linux performance monitoring, see my blog http://rafaxu.blogspot.com.au/2013/12/linux-top-command-in-brief.html, there are a few useful tools for basic performance checking:



System performance checking commands:

#vmstata: give you the basic idea how the system performance.


·         r: The number of processes waiting for run time.
·         b: The number of processes in uninterruptible sleep.

·         swpd: the amount of virtual memory used.
·         free: the amount of idle memory.
·         buff: the amount of memory used as buffers.
·         cache: the amount of memory used as cache.

·         si: Amount of memory swapped in from disk (/s).
·         so: Amount of memory swapped to disk (/s).

·         bi: Blocks received from a block device (blocks/s).
·         bo: Blocks sent to a block device (blocks/s).

·         us: Time spent running non-kernel code. (user time, including nice time)
·         sy: Time spent running kernel code. (system time)
·         id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
·         wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
·         st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.

#losf : list of files. Used to list the processes opening files.

It is very useful to check which process occupies the file
Here is the example.
We open a file in python shell
Then if using lsof command the check which process using the file, you will get the python shell PID and other related information.

#tcpdump, a sniffer like tool to capture the packages

Some useful options and scenarios
Check all the packages for one physical interface: tcpdump –i [interface]
Check all the packages from one IP: tcpdump host [ip]
Check all the packages for one port: tcpdump port [port]
Save the packages to the file: tcpdump –w [file]
Read from the file: tcpdump –r [file]

Other options could be found in ‘man tcpdump’ or ‘tcpdump -help’

#netstat: show the network status of the OS

Some useful options and scenarios
Show the routing table:  netstat –r
Show the listening ports: netstat –l –t (tcp sockets listening)
Show all information : netstat –an (do not resolve to the hostname), you can use grep to find the searching information in the results.

#iostat: show the disk IO status of the OS

To collect and shows the disk related information.

tps: Indicate  the  number  of  transfers per second that were issued to the device.
Blk_read/s: blocks read rate per second
Blk_read: the block read numbers
Blk_write/s: blocks write rate per second
Blk_write: the block write numbers
#ps: shows the running processes
Usually used as ‘ps –ef’ to show all active processes
‘ps -auwwx’ to show the long parameters

No comments:

Post a Comment