# Introduction to benchmarks ## Sysbench Sysbench is a scriptable benchmark tool that evaluates system performance. It includes five kinds of tests: CPU, memory, file I/O, mutex performance, and thread performance. Detailed usage and options can be found by using: ```shell sysbench --help sysbench --test= help ``` Here we list some general commands for evaluation: ```shell # CPU test sysbench --test=cpu --cpu-max-prime= --num-threads= run # Thread test sysbench --test=threads --thread-yields= --num-threads= --max-time= run # Mutex test sysbench --test=mutex --mutex-num= --mutex-locks= --num-threads= # File test, the file-total-size and file-num of prepare and run must be consistent sysbench --test=fileio --file-total-size= --file-num= prepare sysbench --test=fileio --file-total-size= --file-num= --file-test-mode= --file-block-size= --max-time= run # Memory test sysbench --test=memory --memory-block-size= --memory-access-mode= --memory-oper= run ``` ## Membench Membench is used to establish a baseline for memory bandwidth and latency. For specific usage and options, use: ```shell membench --help ``` Here we list some general commands to use membench: ```shell # Measure the latency of mmap membench -runtime=5 -dir=/dev/zero -size= -engine=mmap_lat # Measure the latency of page fault handling. The size must be consistent with the file size. membench -runtime=5 -dir=path_to_a_file -size= -copysize= -mode= -engine=page_fault # This is a easy way to generate a file with target size in Linux. # The following command can create a file named 512K.file with the size 512K. dd if=/dev/zero of=512K.file bs=1K count=512 ``` ## Iperf iPerf is a tool for actively measuring the maximum achievable bandwidth on IP networks. Usage and options are detailed in: ```shell iperf3 -h ``` iperf can run in the following instructions: ```shell export HOST_ADDR=127.0.0.1 export HOST_PORT=8888 iperf3 -s -B $HOST_ADDR -p $HOST_PORT -D # Start the server as a daemon iperf3 -c $HOST_ADDR -p $HOST_PORT # Start the client ```