Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

How to setup WordPress in multiple servers

by | Oct 29, 2018

Many web hosts now guarantee 99.9% uptime for their services, but that still allows up to 8.7 hours of downtime a year.

That is not a risk many companies can afford to take. For eg. Sports news websites that fail right in the middle of a superbowl may lose their loyal followers.

Here at Bobcares, we help WordPress site owners prevent such catastrophic failures by setting up a maintaining a high availability WordPress configuration.

Today we’ll cover how our Support Engineers setup WordPress multiple servers.

 

How to setup WordPress in multiple servers?

Moving WordPress to multiple servers often creates issues like incomplete data across servers, broken session files, slow loading of web pages etc.

Fortunately, these limitations can be corrected by planning and using special tools like HAProxy, Percona XtraDB etc.

And with the help of these software, our Support Engineers have successfully implemented WordPress in multiple servers with just 5 servers.

Let us see the 3 major steps in this implementation.

 

Step 1. High Availability of WordPress files

The first step to maintain website uptime is to ensure that WordPress files are always available.

For this, we use 3 servers and maintain a set of identical website files in each of these servers.

Any actions like WordPress post addition, deletion, media upload etc. done on one server should be updated in all servers instantly. Else visitors may find anomaly in the website.

Since there are too many changes in files, updating them on all servers in shortest span becomes a real challenge.

From our expertise in managing servers, we see that one of the solutions that works well for WordPress files is Unison.

Unison helps to update website content changes across all servers.

 

Step 2. High availability of Databases

We now have same website files in all 3 servers.

WordPress stores all its posts, comments etc. in Databases. Even a small page addition in WordPress involves several database operations.

So the next step is to ensure that the WordPress database works always.

For this, we use database server clusters. For proper working of any cluster, we need a server pool with minimum of 3 servers. The problem with only 2 servers is that, if there is a connection loss between the servers, the entire idea of high availability fails.

It is possible to run multiple services like web server, Database server etc. on the same server.

And so, we set up a database cluster using the same 3 servers which were used for file cluster.

The biggest challenge in database cluster is to replicate database changes in all servers instantly. That is when an entry is removed from database, it has to be removed from other servers too.

And it involves too many read and write operations.

We’ve seen that tools like Percona XtraDB really helps to ensure high availability for databases.

To make databases available always, our Dedicated Support Engineers make configuration changes in Percona XtraDB cluster that includes steps to:

  1. Avoid database update conflicts
  2. Disallow external access
  3. Enable logs for fault analysis

 

Step 3. Set up Load Balancer

Now that we have a WordPress File cluster and Database cluster set up, the next step is to set up a system to handle website requests evenly.

This is where Load Balancer helps. It distributes the visitors evenly among the servers and helps to avoid over-loading of a single server.

If your website has 1000 visitors at a time,  Load Balancer will distribute these visitors to 3 servers and each server need to handle only around 300 visitors.

Based on the specific requirement of customers, we deploy load balancers like HAProxy, which is seen efficient even for website with heavy traffic.

But what if the load balancer itself goes down ? The entire set up fails.

That is why we implement a keep-alive backup server for Load Balancer. This backup server works as a fail-over option for load balancer.

Thus with this setup, a visitor will never experience any website slowness or downtime.

WordPress multiple servers

Conclusion

With proper set up of  WordPress in multiple servers, it is possible to eliminate the risk of website going down due to heavy traffic. Today we saw how our Support Engineers help customers to achieve 100% uptime for WordPress websites.

4 Comments

  1. Andrey

    Where did you store WP sessions on multi-server setup?

    Reply
    • Sijin George

      Hello Andrey,
      On a multi-server setup, storing the sessions on the database helps in encryption and load balancing.

      Reply
      • Pak Kriss

        Hi Sijin, which tool or setup or modification or plugin you have in place to store the sessions in database?

        Reply
        • Sijin George

          Hi Pak,
          This depends a lot on the website type. Many users make use of the Redis session storage too.
          We can check your environment and recommend the one that fits for you. We’ll be happy to talk to you on chat (click on the icon at right-bottom).

          Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF