|
请问是Linux服务器还是Windows服务器?
微软推出了System Center Operation Manager (SCOM)可以完美的解决服务器(支持Linux和Windows)性能监控问题,但是价格不菲。
另一种途径是利用Windows自带的perfmon来监控。或者,自Windows 2008之后的操作系统,有一个命令typeperf。它的帮助如下。从帮助可以看出,它支持收集其他机器上的performance counter,而且机器名、counter名可以从配置文件中读取。你可以预先写好几个配置文件,不同的测试让typeperf加载不同的配置文件,这样就可以监控不同的机器和counter。typeperf的输出可以是csv格式的文本文件,适合进一步分析。
Usage:
typeperf { <counter [counter ...]> | -cf <filename> | -q [object] | -qx [object] } [options]
Parameters:
<counter [counter ...]> Performance counters to monitor.
Options:
-? Displays context sensitive help.
-f <CSV|TSV|BIN|SQL> Output file format. Default is CSV.
-cf <filename> File containing performance counters to monitor, one per line.
-si <[[hh:]mm:]ss> Time between samples. Default is 1 second.
-o <filename> Path of output file or SQL database. Default is STDOUT.
-q [object] List installed counters (no instances). To list counters for one
object, include the object name, such as Processor.
-qx [object] List installed counters with instances. To list counters for one
object, include the object name, such as Processor.
-sc <samples> Number of samples to collect. Default is to sample until CTRL+C.
-config <filename> Settings file containing command options.
-s <computer_name> Server to monitor if no server is specified in the counter path.
-y Answer yes to all questions without prompting.
Note:
Counter is the full name of a performance counter in
"\\<Computer>\<Object>(<Instance>)\<Counter>" format,
such as "\\Server1\Processor(0)\% User Time".
Examples:
typeperf "\Processor(_Total)\% Processor Time"
typeperf -cf counters.txt -si 5 -sc 50 -f TSV -o domain2.tsv
typeperf -qx PhysicalDisk -o counters.txt |
|