Skip to content

Instantly share code, notes, and snippets.

@dmhendricks
Last active June 11, 2023 21:12
Show Gist options
  • Save dmhendricks/cecfad310d40e8aa298ab136622236ae to your computer and use it in GitHub Desktop.
Save dmhendricks/cecfad310d40e8aa298ab136622236ae to your computer and use it in GitHub Desktop.
This is what I use to benchmark new Debian-based instances on any provider, VPS or dedicated.

Linux Benchmarking

These instructions are for Debian-based distributions, but they are similar for RPM-based distros.

It is best to do multiple tests and average the results, especially on VPS which may be affected by peek traffic.

sudo su
apt update && apt upgrade

Overall Performance: Geekbench 4

cd /tmp
wget http://cdn.geekbench.com/Geekbench-4.3.4-Linux.tar.gz
tar xvf Geekbench-4.3.4-Linux.tar.gz
cd Geekbench-4.3.4-Linux
./geekbench4

Network Speed: SpeedTest CLI

apt install python-pip -y
pip install speedtest-cli
speedtest-cli

Disk I/O: fio

cd /tmp
apt install -y make gcc libaio-dev
wget -O - https://github.com/axboe/fio/archive/master.tar.gz | tar zxf -
cd fio-master
make

sync; echo 3 > /proc/sys/vm/drop_caches; ./fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=16 --size=1G --readwrite=randrw --rwmixread=95

Disk I/O: dd

Throughput

sync; echo 3 > /proc/sys/vm/drop_caches; dd if=/dev/zero of=/tmp/test1.img bs=512MB count=5 oflag=dsync

Latency

sync; echo 3 > /proc/sys/vm/drop_caches; dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

Disk Latency: IOping

apt install ioping -y
# Perform 20 iterations
ioping -c 20 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment