Want more timely Centmin Mod News Updates?
Become a Member

Cloudflare Anyone here load balance Wordpress with CloudFlare?

Discussion in 'System Administration' started by BamaStangGuy, May 28, 2019.

  1. BamaStangGuy

    BamaStangGuy Active Member

    May 25, 2014
    Local Time:
    7:28 PM
    Looking to expand to a setup where I have fallbacks. I'd like 2 web servers, 2 MySQL servers (replication) and one fileserver (uploads).

    Does anyone do this? Are there better suggestions?

    The site isn't heavy on uploads so I could probably get away with not having a Fileserver if needed.
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    10:28 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Wordpress under load balanced configuration is definitely doable if you know how to configure it all. I've tried load balancing many different load balancers including haproxy, nginx and even Cloudflare's own Load balancer features (expensive though) i.e. Amazon AWS - Cloudflare - DNS - Thinking of moving from AWS Route53 DNS to Cloudflare and some I haven't tried for even cloud provider's own load balancers for front facing side though choice of load balancer for MySQL end would differ i.e. haproxy or a mysql proxy like proxysql, maxscale combined with MariaDB MySQL replication or MariaDB Galera Cluster or Tungsten Replicator Replication. Then file system layer with and/or GlusterFS, csync2/lsyncd, NFS or SAN disk arrays.

    You'd have to have multiple load balancers for web and mysql segments with fallback so your load balancers do not become single point of failure. So when one load balancer fails, it falls over to the next load balancer etc etc. Usually on web end I have at least 3-5 load balancers which can fall over to each other and act in dual purpose mode as origin backend web servers with distributed load balancer weighting based on which is active load balancer and which origin backend servers share the load with the active load balancer. This way i do not need to have dedicated load balancers as each origin backend server can be promoted to active load balancer as the failover load balancer is also running on each origin backend server. So any origin backend server can become the new active load balancer if needed :) So if I had 11x origin backend servers, I'd have 11x load balancers also running on same origin backend servers where 1 is active load balancer and the other 10x are failover load balancers.

    I usually script and automate it so I can spin up new servers to add a new backend origin servers and install Centmin Mod + restore all site data files/databases within 20-45 minutes thanks to my work and optimisations with multi-threaded backup and restore methods and multi-threaded compression tools. Which means you need to time and benchmark your target backup and restore times that are acceptable for a given server hardware configuration/network setup i.e. target of being able to backup and restore 100GB of data in 10-20 minutes or 40GB data in 3-8 minutes. That's partially why I wrote centminmodbench.sh script etc centminmodbench.sh for dedicated servers and sysbench.sh scripts which tests a servers underlying cpu, ram, disk I/O, network and mysql performance to fully understand how a particular server hardware specification and configuration fairs for all the important metrics :)

    Also keep an eye on Centmin Mod's DigitalOcean 1-click Marketplace App vendor listing support - which will allow you to spin on a DigitalOcean droplet VPS server within minutes with Centmin Mod already pre-installed droplet vendor image and auto optimised out of the box specifically for DigitalOcean's detected server hardware - DigitalOcean Marketplace For 1 Click Applications :) Right now still testing Centmin Mod's DigitalOcean 1-click prebuild images while I let DO's 1-click marketplace mature process wise - not comfortable with how slow replies to my emails/questions are i.e. 2-6+ weeks delay between email replies and all 1-click app image updates are done manually on DO's end - I don't need for an image update to take that long !.

    But you need to ask yourself if the additional costs and time are really needed. Because, if you're not familiar with any segment of such a configuration, then when you run into issues you may end up having more downtime than you would in a non-load balanced configuration.
    • Informative Informative x 2
    • Like Like x 1
    • Winner Winner x 1