Linux System and Network Performance Monitoring
Copyright 2009 Darren Hoch. All rights reserved. 8 of 43
1.2 Determining Baseline Statistics
System utilization is contingent on administrator expectations and system
specifications. The only way to understand if a system is having performance
issues is to understand what is expected of the system. What kind of
performance should be expected and what do those numbers look like? The only
way to establish this is to create a baseline. Statistics must be available for a
system under acceptable performance so it can be compared later against
unacceptable performance.
In the following example, a baseline snapshot of system performance is
compared against a snapshot of the system under heavy utilization.
# vmstat 1
procs memory swap io system cpu
r b swpd free buff cache si so bi bo in cs us sy wa id
1 0 138592 17932 126272 214244 0 0 1 18 109 19 2 1 1 96
0 0 138592 17932 126272 214244 0 0 0 0 105 46 0 1 0 99
0 0 138592 17932 126272 214244 0 0 0 0 198 62 40 14 0 45
0 0 138592 17932 126272 214244 0 0 0 0 117 49 0 0 0 100
0 0 138592 17924 126272 214244 0 0 0 176 220 938 3 4 13 80
0 0 138592 17924 126272 214244 0 0 0 0 358 1522 8 17 0 75
1 0 138592 17924 126272 214244 0 0 0 0 368 1447 4 24 0 72
0 0 138592 17924 126272 214244 0 0 0 0 352 1277 9 12 0 79
# vmstat 1
procs memory swap io system cpu
r b swpd free buff cache si so bi bo in cs us sy wa id
2 0 145940 17752 118600 215592 0 1 1 18 109 19 2 1 1 96
2 0 145940 15856 118604 215652 0 0 0 468 789 108 86 14 0 0
3 0 146208 13884 118600 214640 0 360 0 360 498 71 91 9 0 0
2 0 146388 13764 118600 213788 0 340 0 340 672 41 87 13 0 0
2 0 147092 13788 118600 212452 0 740 0 1324 620 61 92 8 0 0
2 0 147360 13848 118600 211580 0 720 0 720 690 41 96 4 0 0
2 0 147912 13744 118192 210592 0 720 0 720 605 44 95 5 0 0
2 0 148452 13900 118192 209260 0 372 0 372 639 45 81 19 0 0
2 0 149132 13692 117824 208412 0 372 0 372 457 47 90 10 0 0
Just by looking at the numbers in the last column (id) which represent idle time,
we can see that under baseline conditions, the CPU is idle for 79% - 100% of the
time. In the second output, we can see that the system is 100% utilized and not
idle. What needs to be determined is whether or not the system at CPU utilization
is managing.
2.0 Installing Monitoring Tools
Most *nix systems ship with a series of standard monitoring commands. These
monitoring commands have been a part of *nix since its inception. Linux provides these
monitoring tools as part of the base installation or add-ons. Ultimately, there are
packages available for most distributions with these tools. Although there are multiple
open source and 3
rd
party monitoring tools, the goal of this paper is to use tools included
with a Linux distribution.
This paper describes how to monitor performance using the following tools.
期望值是什么?
你有什么样的应用?
你期望系统表现是怎样的?
创建性能基线 baseline