Get the most out of your Centmin Mod LEMP stack
Become a Member

centminmod.com tuned up

Discussion in 'Show Cases & Centmin Testimonials' started by eva2000, Feb 21, 2016.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    8:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    Just finished updating centminmod.com official site's VPS cluster of servers to Centmin Mod 123.09beta01 latest code with Nginx 1.9.11 + ngx_pagespeed 1.10.33.5 dynamic module + ngx_brotli dynamic module and lua nginx 0.10.1-rc1.

    Other stuff done so far:
    1. Tweaked the settings so to disable some nginx pagespeed filters only for HTTP/2 https based requests.
    2. Setup the site for various DNS and CDN related performance comparison tests where .com version is over Amazon Route53 Geo Latency DNS, .net is over Rage4 Geo Proximity based DNS and centmin.sh is version of the site served over Cloudflare free plan with cache optimisations enabled. Proper canonical link headers are in place to centminmod.com so search engines don't view them as duplicate content :)

    webpagetest.org comparison tests



    Did some comparison tests at KeyCDN vs. Cloudflare CDN? | Centmin Mod Community :)

    wpt-route53-vs-cloudflare-la-paris-sg-compared-00.png wpt-route53-vs-cloudflare-la-paris-sg-compared-01.png wpt-route53-vs-cloudflare-la-paris-sg-filmstrip-00.png wpt-route53-vs-cloudflare-la-paris-sg-filmstrip-01.png wpt-route53-vs-cloudflare-la-paris-sg-filmstrip-03.png wpt-route53-vs-cloudflare-la-paris-sg-filmstrip-08.png wpt-route53-vs-cloudflare-la-paris-sg-filmstrip-09.png
     
    Last edited: Feb 21, 2016
    • Like Like x 1
    • Optimistic Optimistic x 1
    • Creative Creative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    8:31 AM
    Nginx 1.13.x
    MariaDB 5.5

    Nginx Load Balanced Deployed



    Updated centminmod.com server cluster to further increase durability by extending Amazon Route53 DNS level Geo Latency with Nginx level load balancing and failover backups.

    Prior


    • Right now centminmod.com uses Amazon Route53 DNS level Geo Latency to direct visitors to the closer geographically located VPS in my VPS cluster of sites which span Seattle, Los Angeles, Dallas, New Jersey, New York, London, Singapore and Sydney locations.
    • If Amazon Route53 health checks detect that the server in that redirected geographical location is down, it it auto fail over to another server within that Amazon Route53 availability region.
    • Example, for US East coast I have 2x New Jersey, 1x New York and 1x Dallas VPS servicing visitors in that US East region. So if one of those 4 servers is down, Amazon Route53 will send visitors to the next VPS. If all 4x VPSes in that region are down, it will auto failover to next closest region which for US East visitors would be the Europe region based London VPS which I only have 1 server for right now. If that fails it will fail over to next available region which would be my US West Seattle and Los Angeles based VPS or my Asian Singapore and Sydney VPSes.

    After Nginx Load Balanced Deployment


    • Operating at the DNS level still has delays due to local DNS caching, so the Nginx load balanced level is the next layer. This allows a server in one VPS geographic region to hold backup servers and load balanced servers served by weightings. So if one VPS server in one geographic region is down, another in the load balanced cluster can serve the visitors for that region without necessarily triggering the Amazon Route53 DNS level health checks.
    • I also take advantage of Centmin Mod Nginx's compiled geoip nginx module to further fine tune where geographic visitors are directed to in the load balance cluster. This also works around a limitation Amazon Route53 DNS has in that it doesn't actually have a mid-USA Dallas end point location I can setup. Route53 only allows me to target geo latencies between either their US West1/2 and US East locations. So my Dallas VPS which is lumped in with New York/New Jersey weighted targets, usually hits US East which is slightly slower ~30-45ms than US East New York and New Jersey. However, with Nginx geoip module, I have setup geo city level targets for most of the US West, US Mid (Texas) and US East locations, so visitors should be served and directed to the right VPS server - in theory :)
    • Another benefit of Nginx level load balancing which is backed by geoip nginx module rules, is for out dated IP address geolocation data. Each IP address has geo location data associated with it. If you check out https://www.iplocation.net/ and input a server's IP address, it may have out dated geo location data. This is common if you're using a cloud hosting provider or provider who has servers offered in multiple geographic locations as the IP address they provide you may have moved between regions. So some of my VPS backend cluster servers have the issue where the provider like Route53 sees the VPS backend as being in an incorrect geographic region that where the server is. This can happen to CDN providers too like Cloudflare, KeyCDN, MaxCDN etc where a visitor in Sydney might be directed to closest CDN edge server or VPS backend server in Singapore as that's what the Singapore VPS server's IP address is reporting for it's geo location. Or it maybe latency based routing and that might be fastest route at DNS level. But having Nginx load balancer use geoip nginx module, I can fine tune which server actually serves that data to that Sydney visitor IF and only if the local server geoip data is up to date with the correct geo data for VPS IP address.

    So as it stands now the following configurations are in play. As Cloudflare backed centmin.sh uses centminmod.com as a origin, it will also essentially be talking with my Nginx level load balanced VPS server cluster too. So a London visitor via centmin.sh will hit a London directed centminmod.com and redirected to a London VPS server backend. If that fails, it will trigger the Nginx load balanced backup VPSes in New York and New Jersey.

    End result using MaxCDN tool to compare centminmod.com vs cloudflare backed centmin.sh is below

    Before Nginx Level Load Balancing + Optimisations



    upload_2016-2-21_23-37-3.png

    After Nginx Level Load Balancing + Optimisations



    centmin.sh cloudflare backed version also benefits from Nginx level geoip load balancing as it's origin is centminmod.com :)

    upload_2016-2-21_23-37-43.png
     
    Last edited: Feb 21, 2016
    • Informative Informative x 1
  3. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    8:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Feb 22, 2016
  4. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    8:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    Using https://pulse.turbobytes.com/ to test DNS response time from 91 worldwide locations
    • centminmod.com - Amazon Route53 DNS
    • centminmod.net - Rage4 DNS
    • centmin.sh - Cloudflare DNS
    upload_2016-2-23_2-24-13.png
    upload_2016-2-23_2-24-36.png
    upload_2016-2-23_2-25-22.png

    and 2nd run

    upload_2016-2-23_2-35-58.png
     
    Last edited: Feb 23, 2016
    • Informative Informative x 1
  5. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    8:31 AM
    Nginx 1.13.x
    MariaDB 5.5
    Pulse Turbobytes HTTP response tests (not DNS response tests) over 91 server locations

    upload_2016-2-23_2-41-23.png

    cloudflare had issues for China test locations

    upload_2016-2-23_2-43-42.png

    but Amazon Route53 had same issues

    upload_2016-2-23_2-45-25.png

    but notice the difference in times for CN - Shanghai

    Amazon Route53 for centminmod.com which I have setup geo latency dns to direct to my Singapore based Centmin Mod LEMP stack VPS server :)
    Code:
    DNS     Connect     TTFB     Total
    47    157    158    369    139.162.29.188:80
    Cloudflare for centmin.sh where DNS time was 3.59x times slower, Connect was 1.45x times slower, TTFB was 3.92x times slower and total time was 2.78x times slower
    Code:
    DNS     Connect     TTFB     Total
    169    228    619    1,024    104.27.173.154:80
     
    Last edited: Feb 23, 2016
    • Informative Informative x 1
Thread Status:
Not open for further replies.