Skip to content

Instantly share code, notes, and snippets.

@ochronus
Last active November 21, 2023 11:28
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save ochronus/8367815 to your computer and use it in GitHub Desktop.
Save ochronus/8367815 to your computer and use it in GitHub Desktop.
CPU and disk benchmarks
# install sysbench
$ apt-get install sysbench
# CPU benchmark, 1 thread
$ sysbench --test=cpu --cpu-max-prime=20000 run
# CPU benchmark, 64 threads
$ sysbench --test=cpu --cpu-max-prime=20000 --num-threads=64 run
# Disk benchmark, random read. See .fio files in this gist
$ mkdir -p /tmp/fio-testing/data
$ fio random-read.fio
# Disk benchmark, real-world use case
$ fio server.fio
[random-read]
rw=randread
size=128m
directory=/tmp/fio-testing/data
; Four threads, two query, two writers.
[global]
rw=randread
size=256m
directory=/tmp/fio-testing/data
ioengine=libaio
iodepth=4
invalidate=1
direct=1
[bgwriter]
rw=randwrite
iodepth=32
[queryA]
iodepth=1
ioengine=mmap
direct=0
thinktime=3
[queryB]
iodepth=1
ioengine=mmap
direct=0
thinktime=5
[bgupdater]
rw=randrw
iodepth=16
thinktime=40
size=32m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment