Sysbench
Je program pro testování hardware počítače na unixových systémech v reálném čase. Sysbench dovede testovat:
Samotný test pracuje v několika možných variantách:
- prepare – připraví
- run – spustí
- cleanup – vyčistí
- help – pomůže
Obsah:
Procesor
Pro otestování procesoru využiji volbu cpu, která ve výchozím stavu bez dalších parametrů testuje pouze jedno jádro. Jestliže chci definovat počet jader (2 jádra), tak přidám parametr –threads=2. Na příkladu níže můžeme vidět příklad testu procesoru o dvou jádrech a následný výpis:
sysbench cpu --threads=2 run
sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 2 Initializing random number generator from current time Prime numbers limit: 10000 Initializing worker threads… Threads started! CPU speed: events per second: 1371.94 General statistics: total time: 10.0010s total number of events: 13724 Latency (ms): min: 1.45 avg: 1.46 max: 3.91 95th percentile: 1.47 sum: 19996.70 Threads fairness: events (avg/stddev): 6862.0000/4.00 execution time (avg/stddev): 9.9983/0.00
Jádra procesoru
Pro test samotných jader použiji volbu threads doplněnou o počet jader –threads=2. Níže je příklad takového příkazu pro test dvou jader procesoru včetně následného výpisu:
sysbench threads --threads=2 run
sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 2 Initializing random number generator from current time Initializing worker threads… Threads started! General statistics: total time: 10.0008s total number of events: 20288 Latency (ms): min: 0.92 avg: 0.99 max: 15.09 95th percentile: 1.03 sum: 19994.47 Threads fairness: events (avg/stddev): 10144.0000/3.00 execution time (avg/stddev): 9.9972/0.00
Paměť
Pro otestování pamětí RAM poslouží volba memory, která pro základní test bohatě stačí. Níže uvidíme příklad příkazu pro test a následný výpis:
sysbench memory run
sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 1 Initializing random number generator from current time Running memory speed test with the following options: block size: 1KiB total size: 102400MiB operation: write scope: global Initializing worker threads… Threads started! Total operations: 30811196 (3080395.89 per second) 30089.06 MiB transferred (3008.20 MiB/sec) General statistics: total time: 10.0000s total number of events: 30811196 Latency (ms): min: 0.00 avg: 0.00 max: 0.18 95th percentile: 0.00 sum: 4440.71 Threads fairness: events (avg/stddev): 30811196.0000/0.00 execution time (avg/stddev): 4.4407/0.00
Zápis I/O
Pro test zápisu na disk použiji volbu fileio, pro kterou se musí ještě definovat parametry testu jako například –file-test-mode=seqwr. Tento test vytvoří zkušební soubory, které musíme smazat. Níže je vypsán příklad příkazu pro test zápisu I/O včetně následného výpisu:
sysbench fileio --file-test-mode=seqwr run
sysbench 1.0.11 (using system LuaJIT 2.1.0-beta3) Running the test with following options: Number of threads: 1 Initializing random number generator from current time Extra file open flags: 0 128 files, 16MiB each 2GiB total file size Block size 16KiB Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing sequential write (creation) test Initializing worker threads… Threads started! File operations: reads/s: 0.00 writes/s: 1425.90 fsyncs/s: 1813.78 Throughput: read, MiB/s: 0.00 written, MiB/s: 22.28 General statistics: total time: 10.0227s total number of events: 32490 Latency (ms): min: 0.01 avg: 0.31 max: 82.63 95th percentile: 0.10 sum: 9970.02 Threads fairness: events (avg/stddev): 32490.0000/0.00 execution time (avg/stddev): 9.9700/0.00
Smazání zkušebních souborů
Tento test vytvoří zkušební soubory, které je třeba ještě smazat. To se provede volbou cleanup:
sysbench fileio --file-test-mode=seqwr cleanup