Monday, January 29, 2018

DigitalOcean versus Linode Performance



Background

I've been consistently using Linode since the summer of 2007 for virtual Linux systems. Their support team has been stellar when it comes to promptness and thoroughness. They also tend to hand out nice surprises in the form of disk space and memory around the time of the company's birth date (June 16.) I have been and continue to be a satisfied customer.

Of course, I've also heard of one of their competitors: DigitalOcean. I have historically come across DigitalOcean's various guides during my web sleuthing for a variety of application installation and configuration inquiries. I have found their documentation to be very helpful. Curiosity finally got the best of me a couple of weeks back and I finally created an account. I was also looking at giving Google Cloud a whirl. I have used AWS and Azure in the past, but the nickel-and-dime cloud pricing model has always bothered me. Easy/flat-rate pricing won for now.

Now that I have given DigitalOcean a spin, I figured I would share my impressions of it along with the results of some performance tests I've conducted in comparison to one of my Linode systems.


What I Like About DigitalOcean

Aside from their excellent collection of documentation which I've already mentioned, their web interface is easy to navigate and is quite clean. I was quite excited to see that they offer and support several releases of FreeBSD. This is something I wanted Linode to do for nearly a decade without the hassle of pushing your own custom image to their site. Can you guess what OS I selected for my first droplet? :) A virtual guest instance is referred to as a "droplet" at DigitalOcean by the way! My droplet was ready in under a minute after filling out the hostname and checking various options (IPv6, internal network support, etc.)

One of the first things I did was recompile my kernel. This operation went smoothly. It is also noteworthy to mention that I have maintained an SSH connection to my first droplet for over a week straight. The network seems quite stable (my droplet is hosted in the NYC3 datacenter.) One of the significant advantages I forgot to comment on is that DigitalOcean plans currently offer more disk capacity than equivalent Linode plans. For example, the $20 plan at Linode allows for 48GB of SSD storage whereas the $20 DigitalOcean plan provides a whopping 80GB of SSD storage. This is certainly nothing to scoff at.

Their API looks to be well written. I have not had the opportunity to use it yet. Additionally, I have not had to open a support ticket for anything at this point. I will update this post with my experience should that ever occur. Lastly, DigitalOcean recently announced the release of their object storage service called "spaces". I plan to take advantage of their 2-month trial to see what it is all about very soon. So far, I am liking DigitalOcean quite a bit.


Performance Test Results

Now that the introductory stuff is out of the way, let's get to the real reason why you're probably here... Let's take a look at the specs first.

DigitalOcean Linode
Geographic Region New York City, NY, USA Dallas, TX, USA
Virtualization Technology KVM KVM
Operating System FreeBSD 11.1 64 bit CentOS 7.2 64 bit
CPU Model Intel(R) Xeon(R) CPU E5-2650L v3 Intel(R) Xeon(R) CPU E5-2680 v2
CPU Frequency 1.80GHz 2.80GHz
Core(s) 1 1
Memory 1GB 1GB
Disk Capacity 25GB 20GB
Disk Type SSD SSD
Filesystem ZFS ext4
Ingress ? 40Gbps
Egress ? 1GbE

CPU Benchmark
Up first are the CPU benchmark results using sysbench. The DigitalOcean FreeBSD system is first:
root@vector:/tmp # date; sysbench --test=cpu --cpu-max-prime=20000 run
Sun Jan 28 21:14:48 EST 2018
sysbench 1.0.11 (using system LuaJIT 2.0.5)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 20000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:   238.70

General statistics:
    total time:                          10.0008s
    total number of events:              2388

Latency (ms):
         min:                                  3.86
         avg:                                  4.17
         max:                                  9.88
         95th percentile:                      4.91
         sum:                               9968.19

Threads fairness:
    events (avg/stddev):           2388.0000/0.00
    execution time (avg/stddev):   9.9682/0.00

And now, the Linode Linux system:
[root@stack /tmp]# date; sysbench --test=cpu --cpu-max-prime=20000 run
Sun Jan 28 21:19:11 EST 2018
sysbench 1.0.9 (using system LuaJIT 2.0.4)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 20000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:   351.07

General statistics:
    total time:                          10.0008s
    total number of events:              3512

Latency (ms):
         min:                                  2.81
         avg:                                  2.85
         max:                                  3.82
         95th percentile:                      2.91
         sum:                               9992.46

Threads fairness:
    events (avg/stddev):           3512.0000/0.00
    execution time (avg/stddev):   9.9925/0.00

Despite DigitalOcean sporting a newer Haswell-based Xeon, Linode's older Ivy Bridge Xeon has a faster clock rate and clearly handles more events per second.

CPU Performance Winner: Linode

Memory Benchmark

This test was performed using a pair of 256M tmpfs RAM-based filesystems. Again, the DigitalOcean FreeBSD system is up first:
root@vector:/mnt # mount -t tmpfs -o size=256m tmpfs /mnt/ramdisk1
root@vector:/mnt # mount -t tmpfs -o size=256m tmpfs /mnt/ramdisk2

root@vector:/mnt # df -h | grep ramdisk
tmpfs                 256M    4.0K    256M     0%    /mnt/ramdisk1
tmpfs                 256M    4.0K    256M     0%    /mnt/ramdisk2

root@vector:/mnt # dd if=/dev/zero of=/mnt/ramdisk1/test bs=1M
dd: /mnt/ramdisk1/test: No space left on device
256+0 records in
255+0 records out
267386880 bytes transferred in 0.154986 secs (1725231326 bytes/sec)

root@vector:/mnt # time cp /mnt/ramdisk1/test /mnt/ramdisk2/test

real    0m1.174s
user    0m0.013s
sys     0m0.509s

root@vector:/mnt # time cmp /mnt/ramdisk1/test /mnt/ramdisk2/test

real    0m1.927s
user    0m0.771s
sys     0m0.135s

And next up is the Linode Linux system:
[root@stack /mnt]# mount -t tmpfs -o size=256m tmpfs /mnt/ramdisk1
[root@stack /mnt]# mount -t tmpfs -o size=256m tmpfs /mnt/ramdisk2

[root@stack /mnt]# df -h | grep ramdisk
tmpfs           256M     0  256M   0% /mnt/ramdisk1
tmpfs           256M     0  256M   0% /mnt/ramdisk2

[root@stack /mnt]# dd if=/dev/zero of=/mnt/ramdisk1/test bs=1M
dd: error writing ‘/mnt/ramdisk1/test’: No space left on device
257+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 0.137701 s, 1.9 GB/s

[root@stack /mnt]# time cp /mnt/ramdisk1/test /mnt/ramdisk2/test

real    0m0.191s
user    0m0.000s
sys     0m0.189s

[root@stack /mnt]# time cmp /mnt/ramdisk1/test /mnt/ramdisk2/test

real    0m0.469s
user    0m0.235s
sys     0m0.232s

The initial memory write times were fairly close between the two providers. The in-memory copy and compare operations were significantly speedier on the Linode as indicated above however.

Memory Performance Winner: Linode

Disk Benchmark

This particular test will use both standard "dd" and sysbench. DigitalOcean FreeBSD system:
root@vector:/tmp # dd if=/dev/zero of=/tmp/test1.img bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 1.928485 secs (543730518 bytes/sec)

root@vector:/tmp # sysbench --test=fileio --file-total-size=1G prepare
sysbench 1.0.11 (using system LuaJIT 2.0.5)

128 files, 8192Kb each, 1024Mb total
Creating files for the test...
Extra file open flags: 0
1073741824 bytes written in 7.59 seconds (134.86 MiB/sec).

And the Linode Linux system:
[root@stack /tmp]# dd if=/dev/zero of=/tmp/test1.img bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 0.977575 s, 1.1 GB/s

[root@stack /tmp]# sysbench --test=fileio --file-total-size=1G prepare
sysbench 1.0.9 (using system LuaJIT 2.0.4)

128 files, 8192Kb each, 1024Mb total
Creating files for the test...
Extra file open flags: 0
1073741824 bytes written in 1.73 seconds (591.77 MiB/sec).

Disk Performance Winner: Linode (substantially)

Network Benchmark
In this test, I'll be pulling down a 1GB file using wget from a competitor of both companies, Vultr. I will be using Vultr's Chicago datacenter which is approximately equidistant between Dallas (Linode) and New York City (DigitalOcean) to test download rates. I will then attempt to sftp the same file to a server in my LAN (which is also fairly centralized between both test locations) to test the upstream of both providers. Here are the results from DigitalOcean:
root@vector:/tmp # wget https://il-us-ping.vultr.com/vultr.com.1000MB.bin
--2018-01-28 23:10:38--  https://il-us-ping.vultr.com/vultr.com.1000MB.bin
Resolving il-us-ping.vultr.com (il-us-ping.vultr.com)... 107.191.51.12
Connecting to il-us-ping.vultr.com (il-us-ping.vultr.com)|107.191.51.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1048576000 (1000M) [application/octet-stream]
Saving to: ‘vultr.com.1000MB.bin’

vultr.com.1000MB.bin                                        100%[========================================================================================================================================>]   1000M  48.3MB/s    in 22s

2018-01-28 23:11:00 (44.8 MB/s) - ‘vultr.com.1000MB.bin’ saved [1048576000/1048576000]
<23:13:20> (~)
[lloyd@lindev] :) > sftp testuser@vector
Connected to vector.
sftp> cd /tmp
sftp> get vultr.com.1000MB.bin
Fetching /tmp/vultr.com.1000MB.bin to vultr.com.1000MB.bin
/tmp/vultr.com.1000MB.bin                       6%   67MB   2.0MB/s   07:56 ETA

The download to my LAN capped out at an even 2MB/sec. Below are the Linode results:
[root@stack /tmp]# wget https://il-us-ping.vultr.com/vultr.com.1000MB.bin
--2018-01-28 23:10:45--  https://il-us-ping.vultr.com/vultr.com.1000MB.bin
Resolving il-us-ping.vultr.com (il-us-ping.vultr.com)... 107.191.51.12
Connecting to il-us-ping.vultr.com (il-us-ping.vultr.com)|107.191.51.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1048576000 (1000M) [application/octet-stream]
Saving to: ‘vultr.com.1000MB.bin’

100%[=================================================================================================================================================================================================>] 1,048,576,000 97.6MB/s   in 9.8s

2018-01-28 23:10:55 (102 MB/s) - ‘vultr.com.1000MB.bin’ saved [1048576000/1048576000]
<23:19:28> (~)
[lloyd@lindev] :) > sftp testuser@stack
Connected to stack.
sftp> cd /tmp
sftp> get vultr.com.1000MB.bin
Fetching /tmp/vultr.com.1000MB.bin to vultr.com.1000MB.bin
/tmp/vultr.com.1000MB.bin                       8%   89MB 978.0KB/s   15:53 ETA

The download to my LAN from Linode in this case never went above 1.1MB/sec. The download from Vultr to Linode was complete in less than half the time as the DigitalOcean transfer.

Network Performance Winner (Download): Linode
Network Performance Winner (Upload): DigitalOcean

*Performance is relative to location and tubing in this context of course!


Final Thoughts

Linode seems to handily outperform DigitalOcean in practically all test cases. Obviously, there are variances within my control which could impact the outcome. Three that come to mind are the platform (FreeBSD vs. Linux), filesystem (ext4 vs. ZFS), and sysbench version (1.0.9 vs. 1.0.11). The filesystem benchmark could potentially be the most affected in this case. However, I highly suspect that Linux on DigitalOcean would yield very similar results.

Would I still recommend and continue to use DigitalOcean? Absolutely -- for the reasons I cited at the beginning of this post. Performance certainly is not everything and DigitalOcean still provides more disk capacity for equivalent pricing along with the option to create a FreeBSD system.

Technology and services are constantly changing. DigitalOcean and Linode will undoubtedly upgrade their hardware and modify their plans again in the future. I hope that any readers found this information insightful.

Edit: I forgot to mention that you can use the following link for a $10 credit at DigitalOcean. This is enough to run a single $10/month or two $5/month instances for 1 month or a single $5 instance for 2 months so you can test drive the service yourself. Enjoy!: https://m.do.co/c/28ccd3d01301

1 comment:

  1. You actually take a look at a know-how plus expert services will be frequently switching. Digital Ocean vs AWS plus Linode will certainly improve its appliance plus customize its blueprints just as before when you need it. Hopefully this every subscriber determined this review fresh new.

    ReplyDelete