Web server clustering for Elgg-based sites

Hey, I am curious about something that isn't really discussed or covered anywhere, really. A cursory search for details pointed me to this six-year-old article on database clustering using a MySQL cluster but for the most part there hasn't been anything discussing how it would be possible to do web-server clustering with Elgg in order to accommodate for higher traffic levels. It seems to me that it is rather impractical to have everything handled by one web-server. And this discussion would affect if I will keep using Elgg in the future. As of now I haven't the slightest clue how to handle this since I literally only started tinkering around with Elgg last week, so some starting points on what to look in to would be nice. 

  • If you split up the webserver from the database server (so 1 dbserver and 1 webserver) you can add as many webservers as you want

    We run several websites with multiple webservers and this is no problem

  • So basically, you can do regular web-server clustering with Elgg-based sites as with regular websites? I was wondering if there was any special configuration or routing that was needed or something. There's like nothing on this subject so I sound pretty ignorant about it lol 

  • indeed, just like the rest of all websites ;)

    make sure you have the correct settings in /engine/settings.php for the database server (so not localhost) and all should be fine and you can run as many webservers as you want

  • Jerome, how do you do upgrades with multiple web servers? Is there required downtime while the new code propagates, out do you have some way to never take the site down?

  • @evan

    Jerome, how do you do upgrades with multiple web servers? Is there required downtime while the new code propagates, out do you have some way to never take the site down?

    In one case we use a nfs share for /htdocs so it replicates automatically, so no downtime (just wait a little bit before flushing cache)

    In another case each webserver has a local copy of /htdocs and this requires some tricky handling in the loadbalancer to be able to update the code. Stop apache on server 1, update server 1, start apache on server 1, repeat for server 2 (only 2 servers behind the loadbalancer). This will first divert all traffic to server 2 (while updating server 1) and then to server 1 (while updating server 2)

  • How do you handle the cases where an upgrade script makes breaking changes to the database?

  • @Jon

    How do you handle the cases where an upgrade script makes breaking changes to the database?

    As long as you have replaced all the code on all the webservers before upgrade or the 'old' webservers aren't running yet this is no problem.

    If you wish to be sure, just make a maintenance window ;) most updates can be done < 15 min

  • make sure you have the correct settings in /engine/settings.php for the database server (so not localhost) and all should be fine and you can run as many webservers as you want

    How do accomplish that? I installed the database in one server. Elgg was installed in the same server. Now, instead I want to have just a server for the database and two separate servers for the site (because of high traffic). Modified the settings.php, but got fatal errors.

    The main problem I have is that the database holds the URL for the site, so you can't install elgg in another webserver/domain/ip address.

    Are there any extra steps I should be taking?

  • @RJ you need a front machine with a single url/ip to manage the incoming traffic and distribute it to webservers machines, and back the response to the user.

    Your front domain (www.example.com) must point to the front machine ip (load balancer), and in Elgg config must be the front domain (www.example.com), so Elgg doesn´t take care about how many webservers are managing the requests.

    This post can be useful for you to understand the structure. http://blog.celingest.com/2014/01/31/interioridades-seguridad-solucion-problemas-elb/

     

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.