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 Premium Member Premium Member

    649
    187
    43
    May 25, 2014
    Ratings:
    +262
    Local Time:
    9:07 AM
    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

    44,521
    10,166
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,738
    Local Time:
    12:07 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.
     
  3. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    4:07 PM
    It is very interesting text. Thank you for sharing it.

    @eva2000 @BamaStangGuy what do you recommend for 2VPS? Which solution will be the best and cost effective (if possible)?

    What is the real price of Cloudlfare load balancing use?
    20USD for Pro account + 5USD for Load balancer? 25USD/month in total? Any extra costs? Per usage or any hidden costs?
     
  4. eva2000

    eva2000 Administrator Staff Member

    44,521
    10,166
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,738
    Local Time:
    12:07 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    already answered that at Use Route53 for geoDNS and Cloudflare for CDN

    see my 2nd post above - minimum for high availability would be at least 3x web servers + 3x web load balancers + 3x database load banacers + 3x mysql servers.
     
  5. upgrade81

    upgrade81 Premium Member Premium Member

    260
    15
    18
    Sep 5, 2016
    Italy
    Ratings:
    +26
    Local Time:
    4:07 PM
    1.17
    10.3
    Try watching Jelastic! It looks fantastic... Can centminmod be used with Jelastic Cloud?
     
  6. eva2000

    eva2000 Administrator Staff Member

    44,521
    10,166
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,738
    Local Time:
    12:07 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Never tested Centmin Mod on it so wouldn't know. Looks like Jelastic is container based ? so probably won't work for Centmin Mod as is right now.