SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Improving Site Response Time
                         Part 2: Global Varnish Cluster with GeoDNS




Kim Stefan Lindholm                          1                        18.2.2012
SETUP
Same components as before with following additions/modifications:

•   Varnish Server: Amazon EC2 Micro Instance (613 MB)

•   Varnish Monitoring: New Relic, Munin, RevealCloud

•   Edge Locations: Tokyo, California, Ireland

•   GeoDNS: EdgeDirector



    DNS and newly added Google Analytics + New Relic code may slightly affect load times
                                             2
Front-end optimization can speed up a
   website but doesn’t tackle network
latency. Content must be brought closer
               to visitors.

                   3
LOAD TIME, BEFORE                                    Target Speed
                                                                     (1.5 Mbps connection)


                                                                     Average: <3.5s
18 s                                                                 Worst Case: <5s


14 s

                                                                           Worst Case
 9s                                                                        Average


 5s



       Los Angeles   São Paulo   Stockholm       Shanghai   Sydney

          ✘            ✘            ✘              ✘         ✘
                                             4
Solution: Set up remote Varnish caches
 and direct visitors to the nearest one
             with GeoDNS


                   5
Varnish serves files that it has previously cached (in its assigned geographic area)
          Varnish fetches uncached or expired content through Incapsula, never directly from website
          Incapsula fetches uncached content from origin server(s)
          If edge server is unresponsive, DNS failover redirects to Incapsula or another Varnish




                             Website

                                              Varnish                                 Varnish
Varnish




                                            Incapsula


                                                    6
LOCAL VS. REMOTE VARNISH
• Why   would we place a Varnish box in the same region as the website?

 • Severalcloud application platforms (CloudControl, Heroku, etc.) have
  Varnish running locally but only default configuration is supported

 • Incapsula
           sets cookies but Varnish doesn't serve cached results to sessions
  with cookies ➔ limited benefits with default settings

 • We’dlike to see cache hit rates of up to 99.9 % so by manually
  configuring Varnish we ensure that it actually does its job

                                      7
LOAD TIME, AFTER                                               Target Speed
                                                                                    (1.5 Mbps connection)


                                             Dotted line denotes load time before   Average: <3.5s
18 s                                                                                Worst Case: <5s


14 s

                                                                                          Worst Case
 9s                                                                                       Average


 5s



       Los Angeles   São Paulo   Stockholm       Shanghai           Sydney

          ✔            ✔           ✔               ✔                 ✔
                                             8
http://royal.pingdom.com/2010/11/12/real-connection-speeds-for-internet-users-across-the-world/




“The average connection speed for
Internet users worldwide, not just among
these 50 countries, but all countries, is
an average of 1.8 Mbit/s”

We’ll use 1.5 Mbit/s and 5.0 Mbit/s
connections in tests that follow

              9
TARGET SPEED, AVERAGE

     1.5 Mbps        <3.5s
     5.0 Mbps        <2.5s

                10
1.5 Mbps




                                    AVERAGE, BEFORE
                                                                                                                                CloudFront




                                                               4.0 s
                                                     3.5 s
                                     2.5 s
                                                                       3.8 s
                                                                                                       4.4 s
                                                       2.9 s
                                    2.7 s
              3.5 s
                                                                                       6.0 s
                                                                                               4.9 s



                                                                               3.7 s

                                             4.9 s

                                                                                                               5.8 s



              <3.5s                                             <3.5s                                                   <3.5s




5 measurements, >20 min intervals                                11                                             DNS Provider: DNS Made Easy
1.5 Mbps




                                    AVERAGE, BEFORE
                                                                                                                                Akamai




                                                               3.6 s
                                                     3.3 s
                                     2.1 s
                                                                       4.5 s
                                                                                                       5.0 s
                                                       3.1 s
                                    2.7 s
              3.7 s
                                                                                       6.2 s
                                                                                               4.8 s



                                                                               4.9 s

                                             4.0 s

                                                                                                               4.8 s



              <3.5s                                             <3.5s                                                   <3.5s




5 measurements, >20 min intervals                                12                                             DNS Provider: DNS Made Easy
1.5 Mbps




                                    CDN COMPARISON
                                                                                                                                       CloudFront

                                                                                                                                         Akamai




                                                                     - 0.4 s
                                                        - 0.2 s
                                    - 0.4 s
                                                                               - 0.7 s
                                                                                                               - 0.6 s
                                                           - 0.2 s
                                    0.0 s
             - 0.2 s
                                                                                               - 0.2 s
                                                                                                         - 0.1 s



                                                                                         - 1.2 s

                                              - 0.9 s

                                                                                                                    - 1.0 s




                                            We’ll be using CloudFront for subsequent tests

5 measurements, >20 min intervals                                       13                                               DNS Provider: DNS Made Easy
1.5 Mbps




                                       AVERAGE, AFTER
                                                                                                                                CloudFront




                                                               1.8 s
                                                     3.4 s
                                     1.9 s
                                                                       1.5 s
                                                                                                       3.0 s
                                                       2.3 s
                                    1.8 s
              2.1 s
                                                                                       2.8 s
                                                                                               3.1 s



                                                                               2.6 s

                                             2.8 s

                                                                                                               2.5 s



              <3.5s                                             <3.5s                                                   <3.5s




5 measurements, >20 min intervals                                14                                                DNS Provider: EdgeDirector
5.0 Mbps




                                       AVERAGE, AFTER
                                                                                                                                CloudFront




                                                               1.2 s
                                                     2.9 s
                                     1.5 s
                                                                       2.0 s
                                                                                                       2.4 s
                                                       1.8 s
                                    1.1 s
              1.7 s
                                                                                       2.2 s
                                                                                               2.6 s



                                                                               1.9 s

                                             2.1 s

                                                                                                               2.0 s



              <2.5s                                             <2.5s                                                   <2.5s




5 measurements, >20 min intervals                                15                                                DNS Provider: EdgeDirector
TARGET SPEED, WORST CASE

       1.5 Mbps        <5.0s
       5.0 Mbps        <4.0s

                  16
1.5 Mbps




                               WORST CASE, BEFORE
                                                                                                                                 CloudFront




                                                                4.4 s
                                                      4.2 s
                                     3.2 s
                                                                        6.0 s
                                                                                                        6.5 s
                                                        3.1 s
                                    3.2 s
              4.3 s
                                                                                        8.0 s
                                                                                                5.3 s



                                                                                4.5 s

                                             10.4 s

                                                                                                                9.8 s



              <5.0s                                              <5.0s                                                   <5.0s




5 measurements, >20 min intervals                                 17                                             DNS Provider: DNS Made Easy
1.5 Mbps




                                    WORST CASE, AFTER
                                                                                                                                 CloudFront




                                                                1.9 s
                                                      4.0 s
                                      2.2 s
                                                                        1.6 s
                                                                                                        4.6 s
                                                        2.3 s
                                     2.1 s
              2.7 s
                                                                                        3.6 s
                                                                                                3.6 s



                                                                                3.2 s

                                              3.9 s

                                                                                                                2.8 s



              <5.0s                                              <5.0s                                                   <5.0s




5 measurements, >20 min intervals                                 18                                                DNS Provider: EdgeDirector
5.0 Mbps




                                    WORST CASE, AFTER
                                                                                                                                 CloudFront




                                                                1.4 s
                                                      3.0 s
                                      1.7 s
                                                                        3.9 s
                                                                                                        3.2 s
                                                        1.9 s
                                     1.2 s
              2.2 s
                                                                                        2.8 s
                                                                                                2.9 s



                                                                                2.2 s

                                              2.2 s

                                                                                                                2.2 s



              <4.0s                                              <4.0s                                                   <4.0s




5 measurements, >20 min intervals                                 19                                                DNS Provider: EdgeDirector
CDN doesn’t guarantee optimal
delivery locations. Where were assets
         actually served from?


                  20
AKAMAI LOCATIONS
                                                   Files were loaded
                                                   from 2 continents




CloudFront seems to load all files from Seattle which is just a simple geo-IP lookup issue

                                           21
How much does a minimal Varnish
        cluster cost?



               22
SERVERS
 VPS / Cloud Server            Locations               RAM       Storage         Price/month


      Linode 512             US, UK, Japan             512 MB     20 GB             $19.95


    Hetzner VQ 7               Germany                 512 MB     20 GB             €7.90


     Zerigo Linux             Denver, CO               512 MB     24 GB              $19


  Amazon EC2 micro         US, EU, Asia, Brazil        613 MB   20 GB (EBS)      $16.7 / $20.7


NB 1: Varnish should run on a 64-bit server
NB 2: Amazon prices are for California and Tokyo, reserved, heavy utilization, 30 GB traffic

                                                  23
GEODNS
                       Zerigo DNS       DNS Made Easy         DNS.com           EdgeDirector
                          Pro 4         Business + GTD        Basic / Pro       + Monitoring

 Monthly Queries         4 million          10 million        5 / 15 million      Unlimited

                                                                               $1.5 / monitor +
  Monthly Price            $20                 $60               $34.95
                                                                               $15 / M queries

 + DNS Failover             X              Included (3)             X            Included (1)

   + DNSSEC                 X                   X               Included              X

  + Vanity Name
                         Included           Included             $44.95               X
     Servers

NB: For a small website, EdgeDirector can cost less than $3/month


                                              24
Without DNS Failover
2 x Linode server + Zerigo DNS (1 M queries)
= 720 USD (~550 EUR) per year

With DNS Failover
2 x Linode server + EdgeDirector (1 M queries)
= 690 USD (~530 EUR) per year


                         25                 Rates in February 2012
LEARNINGS

• Varnishmade a real improvement in response time (up to 7 sec) and as it
 now handles more than 99 % of requests, a website with few DB write
 operations performs fine even on shared cloud hosting

• Varnish boxes don’t scale up automatically but as DNS failover bypasses
 failed edge servers, this doesn’t seem like a problem

• GeoDNS     isn’t always necessary for accelerating a website: even one Varnish
 serving all requests globally will significantly improve performance


                                       26
LEARNINGS


• Amazon    micro instance isn’t suitable for production use due to high CPU
 steal

• Setting
       up Varnish is pretty straightforward, see Part 3 for an example
 configuration on Amazon EC2




                                       27
RESOURCES
•   Cloud & Virtual Private Servers (VPS)

    •   Linode, http://www.linode.com/

    •   Hetzner, http://www.hetzner.de/hosting/produktmatrix_vserver/vserver-produktmatrix

    •   Zerigo, http://www.zerigo.com/vps-servers

    •   Amazon EC2, http://aws.amazon.com/ec2/

•   GeoDNS / Global Server Load Balancing (GSLB)

    •   http://www.zerigo.com/docs/managed-dns/setting_up_geodns

    •   http://help.dnsmadeeasy.com/gtd/configure-gtd-with-dns-failover/

    •   http://dns.com/Help/#configure

    •   http://edgedirector.com/how/both.htm

                                                           28

Contenu connexe

Dernier

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Dernier (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Global Varnish Cluster with GeoDNS

  • 1. Improving Site Response Time Part 2: Global Varnish Cluster with GeoDNS Kim Stefan Lindholm 1 18.2.2012
  • 2. SETUP Same components as before with following additions/modifications: • Varnish Server: Amazon EC2 Micro Instance (613 MB) • Varnish Monitoring: New Relic, Munin, RevealCloud • Edge Locations: Tokyo, California, Ireland • GeoDNS: EdgeDirector DNS and newly added Google Analytics + New Relic code may slightly affect load times 2
  • 3. Front-end optimization can speed up a website but doesn’t tackle network latency. Content must be brought closer to visitors. 3
  • 4. LOAD TIME, BEFORE Target Speed (1.5 Mbps connection) Average: <3.5s 18 s Worst Case: <5s 14 s Worst Case 9s Average 5s Los Angeles São Paulo Stockholm Shanghai Sydney ✘ ✘ ✘ ✘ ✘ 4
  • 5. Solution: Set up remote Varnish caches and direct visitors to the nearest one with GeoDNS 5
  • 6. Varnish serves files that it has previously cached (in its assigned geographic area) Varnish fetches uncached or expired content through Incapsula, never directly from website Incapsula fetches uncached content from origin server(s) If edge server is unresponsive, DNS failover redirects to Incapsula or another Varnish Website Varnish Varnish Varnish Incapsula 6
  • 7. LOCAL VS. REMOTE VARNISH • Why would we place a Varnish box in the same region as the website? • Severalcloud application platforms (CloudControl, Heroku, etc.) have Varnish running locally but only default configuration is supported • Incapsula sets cookies but Varnish doesn't serve cached results to sessions with cookies ➔ limited benefits with default settings • We’dlike to see cache hit rates of up to 99.9 % so by manually configuring Varnish we ensure that it actually does its job 7
  • 8. LOAD TIME, AFTER Target Speed (1.5 Mbps connection) Dotted line denotes load time before Average: <3.5s 18 s Worst Case: <5s 14 s Worst Case 9s Average 5s Los Angeles São Paulo Stockholm Shanghai Sydney ✔ ✔ ✔ ✔ ✔ 8
  • 9. http://royal.pingdom.com/2010/11/12/real-connection-speeds-for-internet-users-across-the-world/ “The average connection speed for Internet users worldwide, not just among these 50 countries, but all countries, is an average of 1.8 Mbit/s” We’ll use 1.5 Mbit/s and 5.0 Mbit/s connections in tests that follow 9
  • 10. TARGET SPEED, AVERAGE 1.5 Mbps <3.5s 5.0 Mbps <2.5s 10
  • 11. 1.5 Mbps AVERAGE, BEFORE CloudFront 4.0 s 3.5 s 2.5 s 3.8 s 4.4 s 2.9 s 2.7 s 3.5 s 6.0 s 4.9 s 3.7 s 4.9 s 5.8 s <3.5s <3.5s <3.5s 5 measurements, >20 min intervals 11 DNS Provider: DNS Made Easy
  • 12. 1.5 Mbps AVERAGE, BEFORE Akamai 3.6 s 3.3 s 2.1 s 4.5 s 5.0 s 3.1 s 2.7 s 3.7 s 6.2 s 4.8 s 4.9 s 4.0 s 4.8 s <3.5s <3.5s <3.5s 5 measurements, >20 min intervals 12 DNS Provider: DNS Made Easy
  • 13. 1.5 Mbps CDN COMPARISON CloudFront Akamai - 0.4 s - 0.2 s - 0.4 s - 0.7 s - 0.6 s - 0.2 s 0.0 s - 0.2 s - 0.2 s - 0.1 s - 1.2 s - 0.9 s - 1.0 s We’ll be using CloudFront for subsequent tests 5 measurements, >20 min intervals 13 DNS Provider: DNS Made Easy
  • 14. 1.5 Mbps AVERAGE, AFTER CloudFront 1.8 s 3.4 s 1.9 s 1.5 s 3.0 s 2.3 s 1.8 s 2.1 s 2.8 s 3.1 s 2.6 s 2.8 s 2.5 s <3.5s <3.5s <3.5s 5 measurements, >20 min intervals 14 DNS Provider: EdgeDirector
  • 15. 5.0 Mbps AVERAGE, AFTER CloudFront 1.2 s 2.9 s 1.5 s 2.0 s 2.4 s 1.8 s 1.1 s 1.7 s 2.2 s 2.6 s 1.9 s 2.1 s 2.0 s <2.5s <2.5s <2.5s 5 measurements, >20 min intervals 15 DNS Provider: EdgeDirector
  • 16. TARGET SPEED, WORST CASE 1.5 Mbps <5.0s 5.0 Mbps <4.0s 16
  • 17. 1.5 Mbps WORST CASE, BEFORE CloudFront 4.4 s 4.2 s 3.2 s 6.0 s 6.5 s 3.1 s 3.2 s 4.3 s 8.0 s 5.3 s 4.5 s 10.4 s 9.8 s <5.0s <5.0s <5.0s 5 measurements, >20 min intervals 17 DNS Provider: DNS Made Easy
  • 18. 1.5 Mbps WORST CASE, AFTER CloudFront 1.9 s 4.0 s 2.2 s 1.6 s 4.6 s 2.3 s 2.1 s 2.7 s 3.6 s 3.6 s 3.2 s 3.9 s 2.8 s <5.0s <5.0s <5.0s 5 measurements, >20 min intervals 18 DNS Provider: EdgeDirector
  • 19. 5.0 Mbps WORST CASE, AFTER CloudFront 1.4 s 3.0 s 1.7 s 3.9 s 3.2 s 1.9 s 1.2 s 2.2 s 2.8 s 2.9 s 2.2 s 2.2 s 2.2 s <4.0s <4.0s <4.0s 5 measurements, >20 min intervals 19 DNS Provider: EdgeDirector
  • 20. CDN doesn’t guarantee optimal delivery locations. Where were assets actually served from? 20
  • 21. AKAMAI LOCATIONS Files were loaded from 2 continents CloudFront seems to load all files from Seattle which is just a simple geo-IP lookup issue 21
  • 22. How much does a minimal Varnish cluster cost? 22
  • 23. SERVERS VPS / Cloud Server Locations RAM Storage Price/month Linode 512 US, UK, Japan 512 MB 20 GB $19.95 Hetzner VQ 7 Germany 512 MB 20 GB €7.90 Zerigo Linux Denver, CO 512 MB 24 GB $19 Amazon EC2 micro US, EU, Asia, Brazil 613 MB 20 GB (EBS) $16.7 / $20.7 NB 1: Varnish should run on a 64-bit server NB 2: Amazon prices are for California and Tokyo, reserved, heavy utilization, 30 GB traffic 23
  • 24. GEODNS Zerigo DNS DNS Made Easy DNS.com EdgeDirector Pro 4 Business + GTD Basic / Pro + Monitoring Monthly Queries 4 million 10 million 5 / 15 million Unlimited $1.5 / monitor + Monthly Price $20 $60 $34.95 $15 / M queries + DNS Failover X Included (3) X Included (1) + DNSSEC X X Included X + Vanity Name Included Included $44.95 X Servers NB: For a small website, EdgeDirector can cost less than $3/month 24
  • 25. Without DNS Failover 2 x Linode server + Zerigo DNS (1 M queries) = 720 USD (~550 EUR) per year With DNS Failover 2 x Linode server + EdgeDirector (1 M queries) = 690 USD (~530 EUR) per year 25 Rates in February 2012
  • 26. LEARNINGS • Varnishmade a real improvement in response time (up to 7 sec) and as it now handles more than 99 % of requests, a website with few DB write operations performs fine even on shared cloud hosting • Varnish boxes don’t scale up automatically but as DNS failover bypasses failed edge servers, this doesn’t seem like a problem • GeoDNS isn’t always necessary for accelerating a website: even one Varnish serving all requests globally will significantly improve performance 26
  • 27. LEARNINGS • Amazon micro instance isn’t suitable for production use due to high CPU steal • Setting up Varnish is pretty straightforward, see Part 3 for an example configuration on Amazon EC2 27
  • 28. RESOURCES • Cloud & Virtual Private Servers (VPS) • Linode, http://www.linode.com/ • Hetzner, http://www.hetzner.de/hosting/produktmatrix_vserver/vserver-produktmatrix • Zerigo, http://www.zerigo.com/vps-servers • Amazon EC2, http://aws.amazon.com/ec2/ • GeoDNS / Global Server Load Balancing (GSLB) • http://www.zerigo.com/docs/managed-dns/setting_up_geodns • http://help.dnsmadeeasy.com/gtd/configure-gtd-with-dns-failover/ • http://dns.com/Help/#configure • http://edgedirector.com/how/both.htm 28