Muchas veces es necesario tener estadísticas de funcionamiento del hardware, para esto existe el paquete sysbench que hace una carga sobre diferentes componentes de los equipos, como los son la CPU o la memoria o los discos duros.
Esta herramienta es muy útil para los administradores de servicios, pues pueden ver como esta el comportamiento de estos y si tiene un historico revisar si la respuesta esta dentro de los terminos normales
Para instalarla es así
root@localhost:~# apt-get install sysbench
Para usarlo pueden revisar la documentación del paquete en http://sysbench.sourceforge.net/docs/ que como podrán ver explica las diferentes funciones, yo solo les mostrare dos básicas que son el análisis de cpu y el análisis de memoria, las cuales se hacen así
root@localhost:~# sysbench --num-threads=12 --test=cpu run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 12
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 10000
Test execution summary:
total time: 43.0129s
total number of events: 10000
total time taken by event execution: 515.4374
per-request statistics:
min: 8.12ms
avg: 51.54ms
max: 147.53ms
approx. 95 percentile: 80.33ms
Threads fairness:
events (avg/stddev): 833.3333/13.04
execution time (avg/stddev): 42.9531/0.04
Running the test with following options:
Number of threads: 12
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 10000
Test execution summary:
total time: 43.0129s
total number of events: 10000
total time taken by event execution: 515.4374
per-request statistics:
min: 8.12ms
avg: 51.54ms
max: 147.53ms
approx. 95 percentile: 80.33ms
Threads fairness:
events (avg/stddev): 833.3333/13.04
execution time (avg/stddev): 42.9531/0.04
root@localhost:~# sys bench --nem-threads=12 --test=memory run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 12
Doing memory operations speed test
Memory block size: 1K
Memory transfer size: 2048M
Memory operations type: write
Memory scope type: global
Threads started!
Done.
Operations performed: 2097152 (184027.82 ops/sec)
2048.00 MB transferred (179.71 MB/sec)
Test execution summary:
total time: 11.3958s
total number of events: 2097152
total time taken by event execution: 104.5250
per-request statistics:
min: 0.01ms
avg: 0.05ms
max: 684.13ms
approx. 95 percentile: 0.00ms
Threads fairness:
events (avg/stddev): 174762.6667/20965.49
execution time (avg/stddev): 8.7104/0.29
Running the test with following options:
Number of threads: 12
Doing memory operations speed test
Memory block size: 1K
Memory transfer size: 2048M
Memory operations type: write
Memory scope type: global
Threads started!
Done.
Operations performed: 2097152 (184027.82 ops/sec)
2048.00 MB transferred (179.71 MB/sec)
Test execution summary:
total time: 11.3958s
total number of events: 2097152
total time taken by event execution: 104.5250
per-request statistics:
min: 0.01ms
avg: 0.05ms
max: 684.13ms
approx. 95 percentile: 0.00ms
Threads fairness:
events (avg/stddev): 174762.6667/20965.49
execution time (avg/stddev): 8.7104/0.29
Desafortunadamente no existen tablas con la que uno pueda comparar los resultados y saber si su mauq2ina esta respondiendo bien o no tanto. Intentare colocar acá una tabla de resultados.
interesante comando...cada día me gusta más mi terminal..
ResponderBorrarSaludos