• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Benchmark your VPS (or dedicated server) CPU, RAM, network and HDD/SSD

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,965
Solutions
99
Reaction score
3,375
Location
Poland
GitHub
gesior
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:
Code:
sudo apt install p7zip-full
Run single thread test:
Code:
7z b -mmt1
Run multi thread test [auto-detects number of cores/threads in CPU]:
Code:
7z b

1.2 CPU - sysbench
Install:
Code:
sudo apt install sysbench
Run tests with 1, 2, 4 and 16 threads:
Code:
sysbench cpu --threads=1 run
sysbench cpu --threads=2 run
sysbench cpu --threads=4 run
sysbench cpu --threads=16 run
FOR OLD VERSION of sysbench - Debian 9 etc. - run tests with 1, 2, 4 and 16 threads:
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
Run tests with 1, 2, 4 and 16 threads:
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
FOR OLD VERSION of sysbench - Debian 9 etc. - run tests with 1, 2, 4 and 16 threads:
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
Run tests with 1, 2, 4 and 16 threads:
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
FOR OLD VERSION of sysbench - Debian 9 etc. - run tests with 1, 2, 4 and 16 threads:
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
Run test:
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
Cleanup after tests - do not cleanup, if you want to run test '4.2 read transfer':
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.
You got to cleanup Linux cache before every test with 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
Cleanup after tests:
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
Run test:
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
Cleanup after tests:
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
Run test:
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
Cleanup after tests:
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
Run test:
Code:
ioping -c 60 .

READING RESULTS
Where is your score:
1.1 CPU - 7zip
---------------------------------- | ------------------------------
Avr: 100 6150 6150 | 100 5068 5068
Tot: 100 5609 5609
1.2 CPU - sysbench
General statistics:
total time: 10.0008s
total number of events: 206746
To make it easier to compare score with other versions of 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

Total operations: 1024 (121399.60 per second)

1024.00 MiB transferred (121399.60 MiB/sec)
2.2 RAM - operations per second
Total operations: 1048576 (25421481.12 per second)

1024.00 MiB transferred (24825.67 MiB/sec)
3.1 Network transfer
Download: 966.78 Mbps (data used: 1.4 GB )
Upload: 972.56 Mbps (data used: 1.3 GB )
4.1 dd - write transfer
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 2,91159 s, 1,5 GB/s
4.2 dd - read transfer
4294967296 bytes (4,3 GB, 4,0 GiB) copied, 1,53457 s, 2,8 GB/s
4.3 fio - write 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.4 fio - read IOPS [operations per second]
Starting 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)
4.5 ioping - latency
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:
Back
Top