Performance is paramount in today’s website world. Google has also included Website Performance as another key criteria in the search rank algorithm it uses (source).
Every decision we make regarding our website either affects performance, flexibility, or both.So how can we combine performance and flexibility?
Docker! Docker is a new service which allows you to virtualize applications.
So why Docker? Docker enables website administrators to install their websites in a Docker container. In the case of WordPress we containerize the entire LAMP stack (Linux, Apache, MySQL, & PHP).
What’s the benefit of Docker containers? A Docker container opens up a huge door of flexibility with a WordPress website. We can now easily move our WordPress container between servers, scale WordPress, load balancing, separate MySQL from WordPress, all without losing performance.
These are just some of the advantages of using Docker. Docker also allows you to "Ship” your container to other people. For example, you can send your entire website to a developer, review the changes, and then integrate the changes to your live website with an easy version control system.
In order to get to grips with Docker, I would highly recommend watching the video from Salmon Hykes Docker's CTO & Founder. He does an excellent job explaining "What is Docker" and the benefits it has in today's IT ecosystems.
Also be sure to checkout the Docker Repository containing all the software installations available directly from Docker. I will cover how we can use some of this software in future articles.
OK, OK. So let’s get down to the nuts and bolts. How does a Docker container with WordPress compare against a bare metal WordPress installation? Well, I’m glad you asked. I've created 2 test systems using Digital Ocean servers (droplets) based in San Francisco with exactly the same hardware specifications.
I chose to run the tests on WordPress as this is the CMS (Content Management System) that has the highest amount of installations on the web. The installation consisted of just a standard WordPress installation with no plugins. I didn't want to run plug-ins as this will take away from the standard installation performance characteristics of WordPress.
Digital Ocean Droplet Specs:
20 GB SSD Disk
1000 GB Transfer
Our Customer Success experts are happy to walk you through Load Impact and empower you to take control of your web performance. Click the button below to schedule a time to chat. Then, go back to enjoying this post on containers!
I used the Load Impact tool to measure the performance of both Droplets. I based the Load Impact test in Palo Alto so it will be in the same region as the Digital Ocean droplets in order to eliminate regional latency. The test simulates a sliding scale of visitors from 1 to 50 accessing the site over a 5 minute period.
I ran several tests on each droplet to ensure the results were consistent and had no one off high or low variation.
(Note: This post contains graphs from our old UI, but the content is too good to mess with, so we've left the post untouched and didn't try to recreate the results. Sign up for a free subscription if you want to see the improved UI in our performance testing platform)
Based on the results above we can clearly see that the Bare Metal WordPress has a slight performance advantage in comparison to the Docker WordPress.
However what we notice with the Docker graph is the consistency in the performance keeping a relatively flat line in comparison to Wordpress Bare Metal.
It is clear a faster Digital Ocean droplet would equalize the performance which we tested and provided the results below.
After increasing the memory of the droplet from 512MB to 1GB the results were the best we've seen of all the tests performed.
Running WordPress or for that matter any other applications inside of Docker compares to Bare Metal performance but also adds portability, scaling, version control and better management of resources.
It is clear that Docker requires slightly more memory in comparison to Bare Metal.
However, as the performance test results revealed, even a slight increase in Docker memory displayed blistering fast results.
So are you ready to go Docker yet?