4 Wordpress sites, 1 server - great performance on Digital Ocean using Nginx and caching

It has taken a few years to level up my experience and to move this site, and four others I host, to an un-managed server/VPS. The time spent learning has paid off, however, as site performance and reliability has gone up across the board, at a much reduced cost.

It has been quite a learning curve, having gone from shared hosting to an expensive but low-performance managed VPS, through to going it alone on an un-managed server. I’ve had to learn how to secure the server, install and configure the low-memory footprint server software (Nginx) for multiple sites and set up an offsite backup in case Digital Ocean’s backup provider (Amazon Glacier, I think I saw somewhere) goes down. Hat-tip to the guide writers at DO; you’ve covered everything.

So now there are four Wordpress sites running on this one low-cost server, served by Nginx and its own caching engine, with Wordpress’ caching plugins working hard alongside that. I use the very smart Obnam software (named, for want of a better name, for ‘Obligatory Name’) to incrementally backup a dump of the databases and site files offsite over a secured connection, further protecting the work gone into creating each site. The encrypted backup ends up on a Raspberry Pi-connected external drive.

It still needs testing, but I suspect each site could handle a reasonable load of traffic for a good few hours before giving in. Tests offered by blitz.io seem to show stability up to around 130 concurrent users, or over 2000 visits per minute; averaging 35 visits per second for 60 seconds. It claims upwards of 3m visits a day are possible, but I take this with a large pinch of salt. I haven’t yet tried this live. The average appearance on the front page of popular tech news sites (HN, Reddit) seems to net somewhere around 5-10k visits over a few hours, so that ought to be covered. Imagine that!

The point being, though, that this could have never happened with the previous host, running on memory-hungry Apache with very limited RAM and processing power, at 6 times the cost to boot.

The previous host, who had provided great support over the years, engaged in a lengthy discussion about my motivation for leaving. I cited a lack of access to the server logs and an inability to install and configure the VPS to get the most out of it. There are many guides showing how much can be done with a low-resource server, and that suits my way of working. But I was warned about low cost server providers competing on price, before then going on to sell the company and leave all its users in uncertain territory. However, Digital Ocean seems to offer a very consistent and high performance service. I am taking care of the offsite backup situation, so if the worst should happen the sites can be quickly redeployed elsewhere.

I wish I’d benchmarked from the previous server, but basically pages always took a few seconds to load and would often hang or give the ‘wsod’ (white screen of death) under more intense database activity. Wordpress is not a light and dainty beast at the best of times. Especially not when loaded up with a few plugins. But now I’m seeing pageloads of under a tenth of a second on a ‘warm’ cache for each site, averaging a few hundred milliseconds. This obviously helps with the user experience and ultimately raises conversions to sales. I did notice a marked increase in site activity following a few such changes, but am yet to be able to fully explain it.

It has been tempting to try to continue evolving and look at static pages for these sites, but the plugin functionality is too useful at present, and the caching solutions too efficient to make it worthwhile. To add to the CMS performance notes, another site I host running on Drupal is seeing similar improvements, with a similar caching arrangement for anonymous and authenticated users giving great loading times.

If you want to experiment, here’s a link to Digital Ocean with my affiliate code. I add this just because they offer it, it’s not at all the aim of this post, but a nice bonus for me if you got anything from it.

 

Published by using 716 words.

Next:
Previous: