How fast will a WordPress site load when hosted on a Nginx+Redis server powered with CloudPanel? How many visitors a WordPress site can get when hosted with LEMP and Redis Cache?
This article seeks to answer those questions.
We believe that some of us are wondering the true performance of Nginx and Redis to serve website’s traffic.
Is it true that Redis Cache is as good as we oftenly heard of?
We did a similar test before. At that time, we used WordOps to deploy a complete LEMP stack plus Redis.
This time we’ll make use of CloudPanel.
Here are some basic differences between CloudPanel vs WordOps:
|Optimized for WP||Yes||No|
Manage from CLI
Benchmark Test Parameters
We use following configurations and server specs for this benchmark test:
Hetzner cloud instance was deployed for the purpose of this benchmark test. The specs are as below:
- CPU: 1 Core vCPU (Intel Xeon)
- RAM: 2GB
- Bandwidth: 20TB
- Storage: 20GB SSD
- Price: €2.89/month
- Provider: Hetzner.
Here’s a nice benchmark test to give you a picture of how the cloud with such specs perform:
Webserver, MySQL, and PHP:
We use Nginx which is a free high-performance webserver, cache, and reverse proxy.
We use default Nginx configuration as coming with CloudPanel. We made no modifications.
Configs we use:
- Linux: Debian 10
- Webserver: Nginx
- Percona Server for MySQL
- PHP v7.3 (php-fpm)
- No Brotli, just GZIP compression
- DNS server by third-party DNS hosting (Cloudflare)
WordPress is the most popular publishing framework. We use it for obvious reasons: easy to set up and free. Here are the details:
- WP version 5.5.1
- 46 posts in total (including Hello World)
- All articles have images (except Hello World)
- Premium theme by Contentberg.
- 14 active plugins (Autoptimize, Redis Object Cache, Really Simple SSL, WP Cerber, etc).
- Domain: speedy.monster (registered at Namesilo)
- Page tested: Main index page (home page).
Website caching is done by three plugins: Autoptimize, Cache Enabler, and Redis Object Cache. We’ll show you why we use such a configuration in the next section.
A. Autoptimize configs:
- CSS optimized, aggregated
- HTML code optimized
- Save aggregated script/CSS as static files? Yes
- Lazy-load images? No
- Remove emojis? Yes
- Remove query strings from static resources? Yes
- Combine and preload Google Fonts in head? Yes
B. Redis Cache configs:
Redis Object Cache plugin does not have further customizations rather helping us to flush caches. It helps connect WordPress with Redis server in the backend.
The parameters used to benchmark are:
- Page load speed – Tools: Pingdom and GTMetrix.
- Time To First Byte (TTFB) – Tools: GTMetrix and KeyCDN
- Number of clients/visitors – Tool: Loader.io free plan
We put screenshot images for every benchmark test. Do not hesitate to click on images to view it larger.
1. Page Load Speed
All tests in this section are using only WordPress and Redis Cache without Autoptimize and Cache Enabler.
Pingdom Speed Test
Pingdom ranks our site as Grade A with 93 points. The tested page loads in 584 ms with a total of 40 requests.
That was conducted on Pingdom’s Frankfurt server. We did it again from Pingdom’s UK server:
Load time is slightly faster.
GTMetrix Website Speed Test
Settings we use to perform page load test in GTMetrix:
- Browser: Google Chrome (Desktop)
- Test server region: London, UK
- Connection mode: off/default
- Adblock: off
- Onload: off
- Video: off
Page load speed result:
The fully loaded time is 1.3 second which is fast. We did the test again but this time Autoptimize and Cache Enabler are activated:
The fully loaded time is now faster at 1.0 second. RUM Speed Index also bumps up from 739 to 578. Also notice how TTFB go faster.
This indicates combining Redis Cache with client-level caching like Cache Enabler and Autoptimize can make the performance even better.
KeyCDN Tools: Website Speed Test
The first test was don from KeyCDN’s Franfurt location. It took 512.59 ms to load the full page.
2. Time To First Byte
Time to First Byte (TTFB) is the total amount of time spent to receive the first byte of the response once it has been requested.
While the whole page load can be dependent on server performance and the site’s content, TTFB is mostly influenced by server performance.
The formula is the sum of Redirect duration + Connection duration + Backend duration.
As we can see from the results generated by GTMetrix above, TTFB scores are below 150ms which are fast.
This not only thanks to Nginx but also to server specs.
3. Stress Load Test (Client Requests)
This test simulates a number of clients connecting or accessing the webserver together at some defined amount of time.
We use free service provided by Loader.io by Sendgrid Labs.
The free plan allows us to have a maximum of 10,000 clients per test and 1-minute test duration.
Test #1: 10,000 clients over 1 minute
Clients will be distributed evenly throughout the test duration. The test will answer this question: How does my server perform when 10000 users connect over the course of 1 minute?
Using only Nginx and Redis did not even deliver a satisfying performance. It failed the test.
Response time was high, and the server generated frequent timeouts. That’s why the test was cancelled.
We don’t really comprehend why this happened. We did the same test using WordOps which was a great success.
So we activated Autoptimize and Cache Enabler and this was the result.
The server seems pretty stable and steady in serving 10,000 clients over the course of 1 minute. No single error, neither timeout nor server error (500).
The graphical stats show CPU usage is no higher than 30%. CPU Load is also around 0.8 core.
Let’s do the Math:
Given the 10,000 visitors per minute, we can calculate how many visitors would be per day. One day equals to 1,440 minutes. Multiply that by 10,000 and we have 14,400,000 visitors/day. That gives you roughly 430 million visitors a month.
Remember that you need to combine Redis Cache with Cache Enabler and Autoptimize plugin.
Test #2: Clients per second over 1 minute
This test simulates a number of clients connecting to the server every second.
The test will answer questions like: How does my server perform when X number of users connect every second over 1 minute period?
That means new users will try to access your every second.
Thus, we can find out the closest number of maximal visitors the server can handle.
Let’s start from 100 clients/sec and see how the server performs.
Redis + Cache Enabler + Autoptimize:
Again, using only Redis could not pass the benchmark test. Even to handle 100 visitors per second CloudPanel’s Nginx+Redis setup failed.
We decided to turn off Redis and to activate Cache Enabler only. Here’s the result:
That’s it, starting from this point we did not continue benchmarking Nginx+Redis only. It would not survive higher benchmark test parameters.
Redis Cache Only:
Redis + Cache Enabler + Autoptimize:
None of them can survive handling 500 request per second.
That was a very surprising result, at least for us.
Reflecting to similar test using WordOps setup, our expectation was too high.
We are not really sure on what goes wrong so that Redis underperforms.
At this point, we cannot recommend to use CloudPanel for high traffic WordPress sites unless if you want to use better srver specs.
CloudPanel offers easy-to-use server management panel to host your websites. We love how sleek its interface is.
However, the easiness its panel offer has a trade-off in terms of performance.