How can you measure VM performance (CPU, Disk, Latency, Concurrent Users etc) on Ubuntu and comparing Vultr, Digital Ocean and UpCloud – Part 3 of 4
Read Part 1, Part 2, Part 3 or Part 4
I used these commands to generate bonnie++ reports from the data in part 2
echo "<h1>Bonnie Results</h1>" > /www-data/bonnie.html echo "<h2>Vultr (Sydney)</h2>" >> /www-data/bonnie.html echo "1.97,1.97,servername,1,1528177870,4G,,656,99,308954,68,113706,33,1200,92,188671,30,10237,251,16,,,,,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,26067us,119ms,179ms,29139us,26069us,16118us,1463us,703us,880us,263us,119us,593us" | bon_csv2html >> /www-data/bonnie.html echo "<h2>Digital Ocean (London)</h2>" >> /www-data/bonnie.html echo "1.97,1.97,servername,1,1528186398,4G,,699,99,778636,74,610414,60,1556,99,1405337,59,+++++,+++,16,,,,,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,17678us,10099us,17014us,7027us,3067us,2366us,1243us,376us,611us,108us,59us,181us" | bon_csv2html >> /www-data/bonnie.html echo "<h2>UpCloud (Singapore)</h2>" >> /www-data/bonnie.html echo "1.97,1.97,servername,1,1528226703,4G,,1014,99,407179,24,366622,32,2137,99,451886,17,+++++,+++,16,,,,,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,11297us,54232us,16443us,4949us,44883us,1595us,264us,340us,561us,138us,66us,327us" | bon_csv2html >> /www-data/bonnie.html
Image of results here
Network Performace
IMHO Network Latency is the biggest impact on server performance, Read my old post on scalability on a budget here. I am in Australia an having a server in Singapore was too far away and latency was terrible.
Here is a non-scientific example of pinging a Vultr, Digital Ocean and UpCloud server in three different locations (and Google).
Test Ping Results
- Vultr 132ms Ping Average (Sydney)
- Digital Ocean 322ms Ping Average (London)
- UpCloud 180ms Ping Average (Singapore)
Latency matters, run a https://www.webpagetest.org/ scan over your site to see why.
Adding https added almost 0.7 seconds to https communications in the past on Digital Ocean (a few thousand kilometres away). The longer the latency the longer HTTPS handshakes take.
Deploying a server to Singapore (in my experience) is bad if your visitors are in Australia. But deploying to other regions may be lower in cost though. It’s a trade-off.
Deploy servers as close as you can to your customers is the best tip for performance.
Also, consider setting up Image Optimization and Image CDN plugins (guide here) in WordPress and using Cloudflare (guide here)
Benchmarking with SysBench
Install CPU Benchmark
sudo apt-get install sysbench
CPU Benchmark (Vultr/Sydney)
Result
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Doing CPU performance benchmark Threads started! Done. Maximum prime number checked in CPU test: 20000 Test execution summary: total time: 39.1700s total number of events: 10000 total time taken by event execution: 39.1586 per-request statistics: min: 2.90ms avg: 3.92ms max: 20.44ms approx. 95 percentile: 7.43ms Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 39.1586/0.00
39.15 seconds
CPU Benchmark (Digital Ocean/London)
sysbench --test=cpu --cpu-max-prime=20000 run
Result
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Doing CPU performance benchmark Threads started! Done. Maximum prime number checked in CPU test: 20000 Test execution summary: total time: 33.4382s total number of events: 10000 total time taken by event execution: 33.4352 per-request statistics: min: 3.24ms avg: 3.34ms max: 6.45ms approx. 95 percentile: 3.45ms Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 33.4352/0.00
33.43 sec
CPU Benchmark (UpCloud/Singapore)
sysbench --test=cpu --cpu-max-prime=20000 run
Result
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Doing CPU performance benchmark Threads started! Done. Maximum prime number checked in CPU test: 20000 Test execution summary: total time: 23.7809s total number of events: 10000 total time taken by event execution: 23.7780 per-request statistics: min: 2.35ms avg: 2.38ms max: 6.92ms approx. 95 percentile: 2.46ms Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 23.7780/0.00
23.77 sec
Surprisingly, 1st place in prime generation goes to UpCloud, then Digital Ocean then Vultr. UpCloud has some good processors.
Processors:
- UpCLoud (Singapore): Intel(R) Xeon(R) CPU E5-2687W v4 @ 3.00GHz
- Digital Ocean (London): Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz
- Vultr (Sydney): Virtual CPU a7769a6388d5 (Masked/Hidden CPU @ 2.40GHz)
(Lower is better)
(oops, typo in the chart should say Vultr)
Benchmark the file IO
Confirm free space
df -h /
Install Sysbench
sudo apt-get install sysbench
I had 10GB free on all servers (Vultr, Digitial Ocean and UpCloud) so I created a 10GB test file.
sysbench --test=fileio --file-total-size=10G prepare sysbench 0.4.12: multi-threaded system evaluation benchmark 128 files, 81920Kb each, 10240Mb total Creating files for the test...
Now I can run the benchmark and use the pre-created text file.
sysbench --test=fileio --file-total-size=10G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run
SysBench description from the Ubuntu manpage.
“SysBench is a modular, cross-platform and multi-threaded benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load. The idea of this benchmark suite is to quickly get an impression about system performance without setting up complex database benchmarks or even without installing a database at all.”
SysBench Results (Vultr/Sydney)
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Initializing random number generator from timer. Extra file open flags: 0 128 files, 80Mb each 10Gb total file size Block size 16Kb Number of random requests for random IO: 0 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing random r/w test Threads started! Time limit exceeded, exiting... Done. Operations performed: 385920 Read, 257280 Write, 823266 Other = 1466466 Total Read 5.8887Gb Written 3.9258Gb Total transferred 9.8145Gb (33.5Mb/sec) 2143.98 Requests/sec executed Test execution summary: total time: 300.0026s total number of events: 643200 total time taken by event execution: 182.4249 per-request statistics: min: 0.01ms avg: 0.28ms max: 18.12ms approx. 95 percentile: 0.55ms Threads fairness: events (avg/stddev): 643200.0000/0.00 execution time (avg/stddev): 182.4249/0.00
SysBench Results (Digital Ocean/London)
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Initializing random number generator from timer. Extra file open flags: 0 128 files, 80Mb each 10Gb total file size Block size 16Kb Number of random requests for random IO: 0 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing random r/w test Threads started! Time limit exceeded, exiting... Done. Operations performed: 944280 Read, 629520 Write, 2014432 Other = 3588232 Total Read 14.409Gb Written 9.6057Gb Total transferred 24.014Gb (81.968Mb/sec) 5245.96 Requests/sec executed Test execution summary: total time: 300.0024s total number of events: 1573800 total time taken by event execution: 160.5558 per-request statistics: min: 0.00ms avg: 0.10ms max: 18.62ms approx. 95 percentile: 0.34ms Threads fairness: events (avg/stddev): 1573800.0000/0.00 execution time (avg/stddev): 160.5558/0.00
SysBench Results (UpCloud/Singapore)
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Initializing random number generator from timer. Extra file open flags: 0 128 files, 80Mb each 10Gb total file size Block size 16Kb Number of random requests for random IO: 0 Read/Write ratio for combined random IO test: 1.50 Periodic FSYNC enabled, calling fsync() each 100 requests. Calling fsync() at the end of test, Enabled. Using synchronous I/O mode Doing random r/w test Threads started! Time limit exceeded, exiting... Done. Operations performed: 994320 Read, 662880 Write, 2121090 Other = 3778290 Total Read 15.172Gb Written 10.115Gb Total transferred 25.287Gb (86.312Mb/sec) 5523.97 Requests/sec executed Test execution summary: total time: 300.0016s total number of events: 1657200 total time taken by event execution: 107.4434 per-request statistics: min: 0.00ms avg: 0.06ms max: 15.43ms approx. 95 percentile: 0.13ms Threads fairness: events (avg/stddev): 1657200.0000/0.00 execution time (avg/stddev): 107.4434/0.00
Comparison
sysbench fileio results (text)
Read
- Vultr (Sydney): 385,920
- Digital Ocean (London): 944,280
- UpCloud (Singapore): 944,320
Write
- Vultr (Sydney): 823,266
- Digital Ocean (London): 629,520
- UpCloud (Singapore): 662,880
Other
- Vultr (Sydney): 1,466,466
- Digital Ocean (London): 3,588,232
- UpCloud (Singapore): 2,121,090
Total Read Gb
- Vultr (Sydney): 5.8887 Gb
- Digital Ocean (London): 14.409 Gb
- UpCloud (Singapore): 15.172 Gb
Total Written Gb
- Vultr (Sydney): 3.9258 Gb
- Digital Ocean (London): 9.6057 Gb
- UpCloud (Singapore): 10.115 Gb
Total Transferred Gb
- Vultr (Sydney): 9.8145 Gb
- Digital Ocean (London): 24.014 Gb
- UpCloud (Singapore): 25.287 Gb
Now I can remove test file io benchmark file
sysbench --test=fileio --file-total-size=2=10G cleanup sysbench 0.4.12: multi-threaded system evaluation benchmark Removing test files...
Confirm the test file has been deleted
df -h / Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 16G 23G 41% /
Bonus: Benchmark MySQL (on my main server (Vultr) not on Digital Ocean and UpCLoud)
I tried to run a command
sysbench --test=oltp --oltp-table-size=1000000 --db-driver=mysql --mysql-db=test --mysql-user=root --mysql-password=#################################### prepare sysbench 0.4.12: multi-threaded system evaluation benchmark FATAL: unable to connect to MySQL server, aborting... FATAL: error 1049: Unknown database 'test' FATAL: failed to connect to database server!
To fix the error I created a test table with Adminer (guide here).