Tuesday 21 January 2014

linux performance monitoring



Linux Performance monitoring
Performance monitoring is a hard job for system admin. It depends on the application running on the box and also the experience of the sys admin. Here are some basic guide for performance measuring.

Good
warning
Bad
CPU
user+sys < 70%
70%<user+sys<90%
user+sys > 70%
Memory
no swap
per CPU < 10 pages/s
lots of SI/SO
DISK
iowait < 20%
20% < iowait < 50%
iowait > 50%

Here we will show about the performance measuring tools and the output.
1.       vmstat: commands: vmstat [interval] [counters]
vmstat is a useful tool to analyse the performance.


Procs: process number:
                r: runnable process but waiting for CPU resource. If there are lots of r, it usually means the cpu resource is not enough (experience value < 2/cpu)
                b: blocked processes waiting for other resource (usually memory or IO)

Memory: memory information:
                swpd:  swaped memory measured by kb
                free:   usable memory
                buff:  buffered memory
                cache: cached memory
swap: swap information
                si: swap in. from disk to memory
                so: swap out. From memory to disk
IO: block IO information:
                Bi: block in. read from disk to memory
                Bo: block out. Write the memory information to disk.
System: 
                In: interruption numbers
                cs: content switch numbers
                there shouldn’t be many Interruptions and content switching for a stable system.
CPU: cpu usage by percentage
                Us: user level, sy: system level, id: idle. Wa: wait for IO.

free command:


Free command is very simple. Just need to understand the
Buffers: blocked IO related memory
Cached: file content cached.

Uptime: 

Showing the current time,  system running time since the last reboot and the current users. It will show the system load for the last min, 5 mins and 15 mins. It should consider the cpu cores when measuring the load.

iostat: check the disk IO status
The most important value is the %iowait: it is usually beblow 20%
%util. the lower the better.

No comments:

Post a Comment