Support » Installing WordPress » Loadbalancing WordPress

  • Hi All,

    I have to install wordpress (One Blog, one domain, for e.g. mycompany.com/blog) on two servers sharing one database on a different server, these two servers are behind a loadbalancer and the db would be on another server. We are planning this way due to high traffic.

    I have done standalone wordpress installations on a single server, on windows 2003, 2008 with IIS6, 7 etc

    I am just researching as to how would I implement this.

    What would be the steps to achieve this and upon searching I saw some posts regarding the wp-content/uploads directory to be synced at regular intervals ?

    your help much appreciated
    Thanks for reading

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mutahir

    (@mutahir)

    Hi All 🙂

    Anyone any thoughts on the above ?

    Kind regards

    volomike

    (@volomike)

    I don’t know with IIS, but perhaps you can translate what I would suggest in Linux and do that with Windows.

    On LAMP, given your problem, I would be mounting a shared volume with either NAS or iSCSI or NFS. I would mount this on each Linux web node as /var/www. The blog code would load on each web node from that code base. That way, there’s no syncing between web nodes because it’s the same file base. Then, I would use LVS (linuxvirtualserver.org) for the web farm, and point it back to a central MySQL database. (That alone would pick up performance. However, to improve the MySQL performance you could cluster it, or at least add replication so that you have a fast system to cutover too in the event of a problem.)

    In the proposed solution above, are you saying that you only need to install WordPress once (on the shared volume) and you can have multiple Apache nodes accessing it? So the only thing running on the web nodes would be Apache (at least to serve up web pages)?

    With what was suggested, yes you would only need to install it once however you would have a single point of failure since, if your file share goes down then so do all of your web sites and the load balancer would be pointless at this point. If you don’t mind a single point of failure and you are only doing this for faster access / load times then yes, this should increase your load time. One way to do this to avoid the single point of failure would be to either have replication between the two drives which can be done (in Linux and most *nix) with DRBD, a regular scheduled rsync or I am sure there are other ways. Another way would be to have two file servers that sync via DRBD and then use fail over with the file servers. You can do this by using NFS like what volomike said but have a second NFS server with an identical share (via DRBD for example) and if the first file server fails, you can have the second file server take over via use of keepalived or something similar. If you do want to get rid of all scenarios where a single host can cause the site to be down then you would also want to implement MySQL clustering and use some sort of Disaster Recovery (DR) / High Availability (HA) with the load balancer itself. You can also use keepalived for Linux based load balancers i.e. if you are using IPVS (or even haproxy) then you have two identical hosts with one inactive that monitors the first one via keepalived and if it finds that the first one is down then it will take over. The main idea behind HA is that you should be able to walk into the data center, unplug any server. I mean any server, take it off the rack and throw it out the window and still have your site running in a way that clients will never even know or be able to find out that anything has changed when any server has been removed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Loadbalancing WordPress’ is closed to new replies.