[Packer01] Section 20.2. Monitoring Intervals

来源:百度文库 编辑:神马文学网 时间:2024/04/28 20:27:44

Monitoring Intervals

One common misconception is that use of these tools negatively impacts system performance. In fact, with the exception ofps and to a lesser extenttop andprstat, it is quite safe to use any of them with intervals as small as 1 or 2 seconds. If you need convincing, try runningvmstat 1 on an idle system. You will find that in spite ofvmstat,the system still shows the CPU as 100% idle (apart from minor systemdaemon activity, which occurs every few seconds with or withoutvmstat running).

Considerable CPU is consumed byps in particular, especially on a heavily loaded system; use it sparingly (every few minutes at the most on a busy system).

Monitoringwith long intervals (five minutes or more) can be useful to get anoverall perspective on performance. Beware, though—the results will bean average over the whole interval, so utilization peaks and troughsare smoothed out and can be completely missed.

Tozoom in on a performance issue, don’t use an interval longer than 10seconds. A 5-second interval is a good choice for visual monitoring orfor statistics collection over periods of up to 20 minutes (240 datapoints).

Note that some tools, such asvmstat,iostat, andvxstat,report the averages since boot time as the first data point. This firstdata point should normally be ignored. So, to get a single 5-secondinterval snapshot fromvmstat, for example, usevmstat52 and ignore the first line of information.