There are many tutorials in Google 'how to benchmark XXX'.
In this thread are tools I tested on Ubuntu 20.04.
With all these tests, it should be easy to compare VPSes and Cloud offers from different companies.
1. CPU
1.1 CPU - 7zip compress/decompress
Install:
Run single thread test:
Run multi thread test [auto-detects number of cores/threads in CPU]:
1.2 CPU - sysbench
Install:
Run tests with 1, 2, 4 and 16 threads:
FOR OLD VERSION of sysbench - Debian 9 etc. - run tests with 1, 2, 4 and 16 threads:
2. RAM
2.1 RAM - transfer
Install:
Run tests with 1, 2, 4 and 16 threads:
FOR OLD VERSION of sysbench - Debian 9 etc. - run tests with 1, 2, 4 and 16 threads:
2.2 RAM - operations per second
Install:
Run tests with 1, 2, 4 and 16 threads:
FOR OLD VERSION of sysbench - Debian 9 etc. - run tests with 1, 2, 4 and 16 threads:
3. Network connection speed
3.1 Network - transfer
Install:
Run test:
4. Disk (HDD/SSD)
4.1 dd - write transfer
Cleanup after tests - do not cleanup, if you want to run test '4.2 read transfer':
4.2 dd - read transfer
In this test we read file created in 'write transfer test'. If you stopped write tests on 1 GB file, you cannot run 4 GB 'read test'.
Cleanup after tests:
4.3 fio - write IOPS [operations per second]
Install:
Run test:
Cleanup after tests:
4.4 fio - read IOPS [operations per second]
Install:
Run test:
Cleanup after tests:
4.5 ioping - latency
This test takes 60 seconds and checks how stable is disk access time (latency).
Install:
Run test:
READING RESULTS
Where is your score:
1.1 CPU - 7zip
In case of score above, it would be 206746 / 10 = 20675 events per second.
2.1 RAM - transfer
In this thread are tools I tested on Ubuntu 20.04.
With all these tests, it should be easy to compare VPSes and Cloud offers from different companies.
1. CPU
1.1 CPU - 7zip compress/decompress
Install:
Code:
sudo apt install p7zip-full
Code:
7z b -mmt1
Code:
7z b
1.2 CPU - sysbench
Install:
Code:
sudo apt install sysbench
Code:
sysbench cpu --threads=1 run
sysbench cpu --threads=2 run
sysbench cpu --threads=4 run
sysbench cpu --threads=16 run
Code:
sysbench --num-threads=1 --test=cpu run
sysbench --num-threads=2 --test=cpu run
sysbench --num-threads=4 --test=cpu run
sysbench --num-threads=16 --test=cpu run
2. RAM
2.1 RAM - transfer
Install:
Code:
sudo apt install sysbench
Code:
sysbench memory --memory-block-size=1M --memory-total-size=1G --threads=1 run
sysbench memory --memory-block-size=1M --memory-total-size=1G --threads=2 run
sysbench memory --memory-block-size=1M --memory-total-size=1G --threads=4 run
sysbench memory --memory-block-size=1M --memory-total-size=1G --threads=16 run
Code:
sysbench --test=memory --memory-block-size=1M --memory-total-size=1G --num-threads=1 run
sysbench --test=memory --memory-block-size=1M --memory-total-size=1G --num-threads=2 run
sysbench --test=memory --memory-block-size=1M --memory-total-size=1G --num-threads=4 run
sysbench --test=memory --memory-block-size=1M --memory-total-size=1G --num-threads=16 run
2.2 RAM - operations per second
Install:
Code:
sudo apt install sysbench
Code:
sysbench memory --memory-block-size=1k --memory-total-size=1G --threads=1 run
sysbench memory --memory-block-size=1k --memory-total-size=1G --threads=2 run
sysbench memory --memory-block-size=1k --memory-total-size=1G --threads=4 run
sysbench memory --memory-block-size=1k --memory-total-size=1G --threads=16 run
Code:
sysbench --test=memory --memory-block-size=1K --memory-total-size=1G --num-threads=1 run
sysbench --test=memory --memory-block-size=1K --memory-total-size=1G --num-threads=2 run
sysbench --test=memory --memory-block-size=1K --memory-total-size=1G --num-threads=4 run
sysbench --test=memory --memory-block-size=1K --memory-total-size=1G --num-threads=16 run
3. Network connection speed
3.1 Network - transfer
Install:
Code:
sudo apt-get install curl
curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install speedtest
Code:
speedtest
4. Disk (HDD/SSD)
4.1 dd - write transfer
- If test takes longer than 30 seconds, ignore tests with bigger files.
- Increase file size to make test run longer than 10 seconds. We want to get real disk write speed, not disk cache speed.
Code:
# 128 MB
dd if=/dev/zero of=/tmp/output.img bs=16M count=8
# 256 MB
dd if=/dev/zero of=/tmp/output.img bs=16M count=16
# 1 GB
dd if=/dev/zero of=/tmp/output.img bs=16M count=64
# 4 GB
dd if=/dev/zero of=/tmp/output.img bs=16M count=256
Code:
rm /tmp/output.img
4.2 dd - read transfer
In this test we read file created in 'write transfer test'. If you stopped write tests on 1 GB file, you cannot run 4 GB 'read test'.
- If test takes longer than 30 seconds, ignore tests with bigger files.
- Increase file size to make test run longer than 10 seconds. We want to get real disk read speed, not disk cache speed.
sync; echo 3 > /proc/sys/vm/drop_caches
.
Code:
# 128 MB
sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/tmp/output.img of=/dev/null bs=16M count=8
# 256 MB
sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/tmp/output.img of=/dev/null bs=16M count=16
# 1 GB
sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/tmp/output.img of=/dev/null bs=16M count=64
# 4 GB
sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/tmp/output.img of=/dev/null bs=16M count=256
Code:
rm /tmp/output.img
4.3 fio - write IOPS [operations per second]
- If test takes longer than 30 seconds, ignore tests with bigger files.
- Increase file size to make test run longer than 10 seconds. We want to get real disk write speed, not disk cache speed.
Install:
Code:
sudo apt-get install fio
Code:
# 64 MB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=64M --readwrite=randwrite
# 128 MB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=128M --readwrite=randwrite
# 512 MB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=512M --readwrite=randwrite
# 1 GB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1G --readwrite=randwrite
# 4 GB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randwrite
Code:
rm test
4.4 fio - read IOPS [operations per second]
- If test takes longer than 30 seconds, ignore tests with bigger files.
- Increase file size to make test run longer than 10 seconds. We want to get real disk read speed, not disk cache speed.
Install:
Code:
sudo apt-get install fio
Code:
# 64 MB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=64M --readwrite=randread
# 128 MB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=128M --readwrite=randread
# 512 MB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=512M --readwrite=randread
# 1 GB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1G --readwrite=randread
# 4 GB
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread
Code:
rm test
4.5 ioping - latency
This test takes 60 seconds and checks how stable is disk access time (latency).
Install:
Code:
sudo apt-get install ioping
Code:
ioping -c 60 .
READING RESULTS
Where is your score:
1.1 CPU - 7zip
1.2 CPU - sysbench---------------------------------- | ------------------------------
Avr: 100 6150 6150 | 100 5068 5068
Tot: 100 5609 5609
To make it easier to compare score with other versions ofGeneral statistics:
total time: 10.0008s
total number of events: 206746
sysbench
, you should divide number of events by number of seconds.In case of score above, it would be 206746 / 10 = 20675 events per second.
2.1 RAM - transfer
2.2 RAM - operations per secondTotal operations: 1024 (121399.60 per second)
1024.00 MiB transferred (121399.60 MiB/sec)
3.1 Network transferTotal operations: 1048576 (25421481.12 per second)
1024.00 MiB transferred (24825.67 MiB/sec)
4.1 dd - write transferDownload: 966.78 Mbps (data used: 1.4 GB )
Upload: 972.56 Mbps (data used: 1.3 GB )
4.2 dd - read transfer4294967296 bytes (4,3 GB, 4,0 GiB) copied, 2,91159 s, 1,5 GB/s
4.3 fio - write IOPS [operations per second]4294967296 bytes (4,3 GB, 4,0 GiB) copied, 1,53457 s, 2,8 GB/s
4.4 fio - read IOPS [operations per second]Starting 1 process
Jobs: 1 (f=1): [w(1)][-.-%][w=1270MiB/s][w=325k IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=121223: Mon Jan 17 17:52:03 2022
write: IOPS=294k, BW=1147MiB/s (1202MB/s)(4096MiB/3572msec); 0 zone resets
4.5 ioping - latencyStarting 1 process
Jobs: 1 (f=1): [r(1)][100.0%][r=774MiB/s][r=198k IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=121246: Mon Jan 17 17:52:43 2022
read: IOPS=198k, BW=774MiB/s (812MB/s)(4096MiB/5292msec)
59 requests completed in 8.69 ms, 236 KiB read, 6.79 k iops, 26.5 MiB/s
generated 60 requests in 59.0 s, 240 KiB, 1 iops, 4.07 KiB/s
min/avg/max/mdev = 85.4 us / 147.2 us / 247.8 us / 32.9 us
Last edited: