The availability and performance have a direct business impact and therefore are major factors when choosing a hosting service. Obviously, no one wants to lose money because of occasional downtime, but at the same time – no one can be completely safe from it. Thus, to minimize the risk of such issue occurrence and to ensure an extra level of redundancy, the clustering approach can be used. Today, we’ll take a closer look at auto-scaling and clusterization of WordPress CMS.

WordPress cluster helps to handle permanent high load and huge load spikes, ensures zero downtime, improves performance, cuts maintenance costs, and, as a result, offers an excellent experience for end-users.

In this article, we’ll cover how to:

  • install a WordPress cluster powered by NGINX and a highly available MariaDB Galera cluster
  • get a free Let’s Encrypt SSL certificate with automatic renewal
  • bind a custom domain and update the certificate
  • scale dynamically based on the load

Auto-Scalable WP Cluster in Containers

Our out-of-the-box automated WordPress Cluster solution is based on Jelastic dockerized templates and provides the latest WordPress CMS version. The key components of the environment with this package deployed are the following:

  • for distributing incoming traffic within a cluster, an NGINX load balancer is used; herewith, it can be manually scaled horizontally after installation, whilst the newly added node(s) discover available application servers automatically
  • the WordPress application itself is handled with two NGINX PHP servers that are automatically scaled based on the preconfigured triggers
  • three replicated MariaDB Galera Cluster to store and operate user data
  • Shared Storage In order to keep WordPress static assets, the shared storage is used for all web-servers in the cluster.

Deploying WordPress Cluster in One Click

Being usually rather complicated and time-consuming, with Unispace operations of the WordPress cluster deployment and configuration represent the completely automated processes. Just a few elementary actions:

1. Log in to the Unispace Dashboard with your credentials and start the installation in one of the following ways:

  • Marketplace

Just type the package name into the search field within the opened frame and click on Install at the shown solution plank. 

2. In the opened installation window, you can customize your WordPress Cluster.

This Scaling Strategy parameter aims to foresee possible upcoming load growth in the cluster and scale out the application servers horizontally in order to prevent WordPress application downtime. Let’s take a look at how it works.

Unispace with Jelastic PaaS allows automatically scale in/out servers using specially configured triggers. Based on our experience, we offer three common scaling scenarios for WordPress to prevent overload (these settings can be adjusted after installation):

  • Low Load
    • adds 1 application server node if the workload is higher than 70%
    • removes 1 application server node if the workload goes below 20%
  • Medium Load
    • adds 1 application server node if the workload is higher than 50%
    • removes 1 application server node if the workload goes below 20%
  • High Load
    • adds 2 application server node if the workload is higher than 30%
    • removes 1 application server node if the workload goes below 10%

3. Activate the preferred Advanced Features.

MariaDB Galera Cluster is a multi-master database cluster based on synchronous replication and InnoDB engine. When using the Galera Cluster, you can perform direct read and write operations to any node. If any single instance goes down, there will be no cluster downtime and no complex failover procedures.In case you untick the checkbox, a regular standalone MariaDB database will be installed. Thus, high availability and failover capabilities will be significantly decreased.

Let’s Encrypt SSL with Auto-Renewal add-on allows to issue and use a trusted, free certificate for a custom domain. The built-in functionality employs periodical renewal to prevent certificate expiration. The appropriate notifications are sent by email.

WordPress Multisite Network enables/disables the same-named feature. It allows the application to act as a WordPress network hub, where the network can comprise several websites. With this built-in feature and Jelastic automation, you can create an independent network of websites and invite others to develop their sites on the same network even for commercial usage.

4. Specify Environment name, Display Name, choose availability Region and click Install. Wait several minutes for Unispace to set up your WordPress Cluster.

Use the links and credentials from the successful installation frame or from the appropriate email to manage your WordPress application (or even create a network).

5. Finally, click the Open in Browser button at the bottom of the window and open your fresh new WordPress Cluster site.

Install Highly-Available WordPress