SlideShare une entreprise Scribd logo
1  sur  52
Télécharger pour lire hors ligne
Designing, Scoping, and Configuring
Scalable Drupal
Infrastructure


Presented 2009-05-30 by David Strauss
Understanding
Load Distribution
Predicting peak traffic
Traffic over the day can be highly irregular. To plan
for peak loads, design as if all traffic were as heavy
as the peak hour of load in a typical month -- and
then plan for some growth.
Analyzing hit distribution
                                                                                       40%
                                     30%
                                                                Hu man
                              e nt
                            nt                                                                                        3%
                      icC
                          o                          50%
                  t
              Sta
                                                                                                                  t
                                                                                                               en




                                                         W
                                                                                                         t   m




                                                          eb
                                                                                                     rea
                                                                                                 al T




                                                           Cr
100%                                                                                     ci




                                                             aw
                                                                                      pe
                                                 s
                                               ou                                   S




                                                               le
                                                                              No




                                                                  r
                                            ym

                                                                      10%
                                        on
       Dy
          n




                                       An
         am




                                                                            “P
            i cP




                                                                              ay
                                                                                   W
                ag




                                                                                    al
                                                                                       l”
                  es




                                                                                            By
                                                                                              pa
                                                                                                   ss
                                 70%
                                        Auth
                                             entic
                                                  ated                                                   7%
                                                         20%
Throughput vs. Delivery Methods
                             Green                    Yellow                     Red
                            (Static)            (Dynamic, Cacheable)          (Dynamic)
                                                                     2
 Content Delivery
    Network
                      ●●●●●●●●●●                          ✖                       ✖

Reverse Proxy Cache   ●●●●●●●                    ●●●●●●●                          ✖
                                   1000 req/s

                                          1
Drupal + Page Cache
   + memcached
                      ●●●                        ●●●                              ✖
                                          1
Drupal + Page Cache   ●●●                        ●●                               ✖
                                          1
      Drupal          ●●●                        ●                       ●
                                                                                      10 req/s
                                                 1   Delivered by Apache without Drupal
More dots = More throughput                      2   Some actually can do this.
Objective

Deliver hits using the
fastest, most scalable
  method available.
Layering: Less Traffic at Each Step

         Your Datacenter



            Load             Reverse
                                       Application
 Traffic     Balancer
                              Proxy
                                         Server
                              Cache


           DNS Round Robin


 CDN                                   Database
Offload from the master database
      Search      Your master database is the single
                  greatest limitation on scalability.



    Application         Slave
      Server           Database




                      Master
     Memory
      Cache
                     Database
Tools to use
‣   Apache Solr for search.
    (Acquia offers hosting of this now.)
‣   Squid or Varnish for reverse proxy caching.
‣   Any third-party service for CDN.
Do the math
‣   All non-CDN traffic travels through your load
    balancers and reverse proxy caches. Even traffic
    passed through to application servers must run
    through the initial layers.


                  Load              Reverse
                                                  Application
    Traffic        Balancer
                                     Proxy
                                                    Server
                                     Cache



            What hit rate is each layer geing?
            How many servers share the load?
Get a management/monitoring box
                Load        (maybe two or three
               Balancer          and have them
                                  specialized or
                                    redundant)


                               Application
    Database   Management
                                 Server




                Reverse
                 Proxy
                 Cache
Planning + Scoping
Infrastructure goals
‣   Redundancy
‣   Scalability
‣   Performance
‣   Manageability
Redundancy
‣   When one server fails, the website should
    be able to recover without taking too long.
‣   This requires N+1, putting a floor
    on system requirements.
‣   How long can your site be down?
    ‣   Automatic versus manual failover
Performance
‣   Find the “sweet spot” for hardware. This is the
    best price/performance point.
‣   Avoid overspending on any type of component
‣   Yet, avoid creating bottlenecks
‣   Swapping memory to disk is very dangerous
Relative importance
                  Processors/Cores       Memory   Disk Speed


 Reverse Proxy
    Cache         ●                  ●●●          ●●

  Web Server      ●●●●●              ●●           ●

Database Server   ●●                 ●●●●         ●●●●

  Monitoring      ●                  ●            ●
Reverse proxy caches
‣   Squid makes poor use of multiple cores. Focus on
    getting the highest per-core performance. The
    best per-core performance is often on dual-core
    processors with high clock rates and lots of cache.
‣   Varnish is much more multithreaded.
‣   4-8 GB memory, total
‣   Expect 1000 requests per second, per Squid
‣   64-bit operating system if more than 2 GB RAM
Web servers
‣   Apache 2.2 + mod_php + memcached
‣   Many processors + many cores is best
‣   25 Apache threads per core
‣   50 MB memory per thread, system-wide
‣   1 GB memory for system
‣   1 GB memory for memcached
‣   Configure MaxClients in Apache to maximum
    system-wide thread count
‣   Expect 1 request per thread, per second
Database servers
‣   MySQL 5.0 cannot use more than eight cores
    effectively but gets good gains from at least quad-
    core processors.
‣   Depend on each Apache thread needing one
    connection, and add another 50.
‣   Each MySQL connection needs around 6 MB.
‣   MySQL with InnoDB needs a buffer pool large
    enough to cache all indexes. Start by giving the
    pool most remaining database server memory and
    working from there.
‣   64-bit operating system if more than 2 GB RAM
Monitoring server
‣   Very low hardware requirements
‣   Choose hardware that is inexpensive but
    essentially similar to the rest of the cluster to
    reduce management overhead
‣   Reliability and fast failover are typically low
    priorities for monitoring services
Assembling the numbers
‣   Start with an architecture providing redundancy.
    ‣   Two servers, each running the whole stack
‣   Increase the number of proxy caches based on
    anonymous and search engine traffic.
‣   Increase the number of web servers based on
    authenticated traffic.
‣   Databases are harder to predict, but large sites
    should run them on at least two separate boxes
    with replication.
Pressflow
Make Drupal sites scale by upgrading core
with a compatible, powerful replacement.
Common large-site issues
‣   Drupal core requires patching to effectively
    support the advanced scalability techniques
    discussed here.
‣   Patches often conflict and have to be reapplied
    with each Drupal upgrade.
‣   The original patches are often unmaintained.
‣   Sites stagnate, running old, insecure versions of
    Drupal core because updating is too difficult.
What is Pressflow?
‣   Pressflow is a derivative of Drupal core that
    integrates the most popular performance and
    scalability enhancements.
‣   Pressflow is completely compatible with existing
    Drupal 5 and 6 modules, both standard and
    custom.
‣   Pressflow installs as a drop-in replacement for
    standard Drupal.
‣   Pressflow is free as long as the matching version of
    Drupal is also supported by the community.
What are the enhancements?
‣   Reverse proxy support
‣   Database replication support
‣   Lower database and session management load
‣   More efficient queries
‣   Testing and optimization by Four Kitchens
    with standard high-performance software
    and hardware configuration
‣   Industry-leading scalability support
    by Four Kitchens and Tag1 Consulting
Four Kitchens + Tag1
‣   Provide the development, support, scalability, and
    performance services behind Pressflow
‣   Comprise most members of the Drupal.org
    infrastructure team
‣   Have the most experience scaling Drupal sites
    of all sizes and all types
Ready to scale?
‣   Learn more about Pressflow:
    ‣   Pick up pamphlets in the lobby
    ‣   Request Pressflow releases at fourkitchens.com
‣   Get the help you need to make it happen:
    ‣   Talk to me (David) or Todd here at DrupalCamp
    ‣   Email shout@fourkitchens.com
Managing the Cluster
The problem
                            Soware and
                            Configuration




Application   Application   Application    Application   Application
  Server        Server        Server         Server        Server


Objectives:
Fast, atomic deployment and rollback
Minimize single points of failure and contention
Restart services
Integrate with version control systems
Manual updates and deployment

   Human         Human         Human         Human         Human




 Application   Application   Application   Application   Application
   Server        Server        Server        Server        Server




Why not: slow deployment,
non-atomic/difficult rollbacks
Shared storage
 Application   Application   Application   Application   Application
   Server        Server        Server        Server        Server




                                NFS




Why not: single point of contention and failure
rsync
                             Synchronized
                              with rsync




 Application   Application   Application    Application   Application
   Server        Server        Server         Server        Server




Why not: non-atomic, does not manage services
Capistrano
                               Deployed with
                                Capistrano




   Application   Application   Application     Application   Application
     Server        Server        Server          Server        Server




Capistrano provides near-atomic deployment,
service restarts, automated rollback, test automation, and
version control integration (tagged releases).
Multistage deployment
                          Deployments
 Deployed with                                               Deployed with
  Capistrano              can be staged.                      Capistrano
                        cap staging deploy
                        cap production deploy

 Development
  Integration                  Deployed with                   Staging
                                Capistrano




Application      Application   Application     Application       Application
  Server           Server        Server          Server            Server
But your application isn’t the only
        thing to manage.
Beneath the application
  Reverse
                             Cluster-level
   Proxy                                                   Database
                             configuration
   Cache




 Application   Application   Application     Application   Application
   Server        Server        Server          Server        Server


Cluster management applies to package management,
updates, and soware configuration.

cfengine and bcfg2 are popular
cluster-level system configuration tools.
System configuration management
‣   Deploys and updates packages, cluster-wide or
    selectively.
‣   Manages arbitrary text configuration files
‣   Analyzes inconsistent configurations (and
    converges them)
‣   Manages device classes (app. servers, database
    servers, etc.)
‣   Allows confident configuration testing on a
    staging server.
All on the management box




                   {
                       Development
                        Integration




                         Staging


      Management

                       Deployment
                          Tools




                        Monitoring
Monitoring
Types of monitoring
        Failure           Capacity/Load

   Analyzing Downtime    Analyzing Trends

    Viewing Failover     Predicting Load

    Troubleshooting     Checking Results of
                         Configuration and
      Notification       Soware Changes
Everyone needs both.
What to use

    Failure/Uptime   Capacity/Load

       Nagios            Cacti

       Hyperic          Munin
Nagios
‣   Highly recommended.
‣   Used by Four Kitchens and Tag1 Consulting for
    client work, Drupal.org, Wikipedia, etc.
‣   Easy to install on CentOS 5 using EPEL packages.
‣   Easy to install nrpe agents to monitor diverse
    services.
‣   Can notify administrators on failure.
‣   We use this on Drupal.org
Hyperic
‣   I haven’t used this much, but it’s fairly popular.
‣   More difficult to set up than Nagios.
Cacti
‣   Highly annoying to set up.
‣   One instance generally collects all statistics.
    (No “agents” on the systems being monitored.)
‣   Provides flexible graphs that can be customized on
    demand.
‣   Optimized database for perpetual statistics collection.
‣   We use this on Drupal.org and for client sites.
Munin
‣   Fairly easy to set up.
‣   One instance generally collects all statistics.
    (No “agents” on the systems being monitored.)
‣   Provides static graphs that cannot be
    customized.
Cluster Problems
Cache/session coherency
‣   Systems that run properly on single boxes may
    lose coherency when run on a networked cluster.
‣   Some caches, like APC’s object cache, have no
    ability to handle network-level coherency. (APC’s
    opcode cache is safe to use on clusters.)
‣   memcached, if misconfigured, can hash values
    inconsistently across the cluster, resulting in
    different servers using different memcached
    instances for the same keys.
‣   Session coherency can be helped with load
    balancer affinity.
Cache regeneration races
‣   Downside to network cache coherency: synched
    expiration
‣   Hard to solve
                     All servers regenerating the item.



           Old Cached Item



                     Expiration
                                  {                  New Cached Item




    Time
Broken replication
‣   MySQL slave servers get out of synch, fall further
    behind
‣   No means of automated recovery
‣   Only solvable with good monitoring and recovery
    procedures
‣   Can automate removal from use, but requires
    cluster management tools
Server failure
‣   Load balancers can remove broken or overloaded
    application reverse proxy caches.
‣   Reverse proxy caches like Varnish can automatically
    use only functional application servers.
‣   Cluster management tools like heartbeat2 can manage
    service IPs on MySQL servers to automate failover.
‣   Conclusion: Each layer intelligently monitors and uses
    the servers beneath it.
All content in this presentation, except where noted otherwise, is Creative Commons Attribution-
ShareAlike 3.0 licensed and copyright 2009 Four Kitchen Studios, LLC.

Contenu connexe

Similaire à Scalable Drupal infrastructure

What is e market services 2010
What is e market services  2010What is e market services  2010
What is e market services 2010eMarket Services
 
OpenID Foundation Japan Chapter Announcement
OpenID Foundation Japan Chapter AnnouncementOpenID Foundation Japan Chapter Announcement
OpenID Foundation Japan Chapter AnnouncementDavid Recordon
 
MobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / GermanyMobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / GermanyAvenga Germany GmbH
 
Idenitifying the fit for perennial forage options in a crop-livestock system:...
Idenitifying the fit for perennial forage options in a crop-livestock system:...Idenitifying the fit for perennial forage options in a crop-livestock system:...
Idenitifying the fit for perennial forage options in a crop-livestock system:...Joanna Hicks
 
Lease Buyout Cost Reduction Six Sigma Case Study
Lease Buyout Cost Reduction Six Sigma Case StudyLease Buyout Cost Reduction Six Sigma Case Study
Lease Buyout Cost Reduction Six Sigma Case StudySteven Bonacorsi
 
Introduction to Continuous Delivery
Introduction to Continuous DeliveryIntroduction to Continuous Delivery
Introduction to Continuous DeliveryKmanthei
 
Geography of time and touchpoints time use planning 2012
Geography of time and touchpoints time use planning 2012Geography of time and touchpoints time use planning 2012
Geography of time and touchpoints time use planning 2012Posterscope
 
KlikEyeDoc User Guide
KlikEyeDoc User GuideKlikEyeDoc User Guide
KlikEyeDoc User GuideManohar Vijay
 
COH Online- The future of screening for distress in cancer settings (February11)
COH Online- The future of screening for distress in cancer settings (February11)COH Online- The future of screening for distress in cancer settings (February11)
COH Online- The future of screening for distress in cancer settings (February11)Alex J Mitchell
 
30 Minute Expert1
30 Minute Expert130 Minute Expert1
30 Minute Expert1Ben Wilkoff
 
Designing learning spaces to meet the changing needs and expectations of stud...
Designing learning spaces to meet the changing needs and expectations of stud...Designing learning spaces to meet the changing needs and expectations of stud...
Designing learning spaces to meet the changing needs and expectations of stud...Dan Munnerley
 
ASRR Keynote by Barry Dahl
ASRR Keynote by Barry DahlASRR Keynote by Barry Dahl
ASRR Keynote by Barry DahlBarry Dahl
 
6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box Presentation6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box PresentationRalphYoung
 
PowerPoint Design
PowerPoint DesignPowerPoint Design
PowerPoint Designpcorey
 
Toolkit eleni katrini
Toolkit eleni katriniToolkit eleni katrini
Toolkit eleni katriniekatrini
 

Similaire à Scalable Drupal infrastructure (20)

What is e market services 2010
What is e market services  2010What is e market services  2010
What is e market services 2010
 
Sfm Washington 20081120
Sfm Washington 20081120Sfm Washington 20081120
Sfm Washington 20081120
 
OpenID Foundation Japan Chapter Announcement
OpenID Foundation Japan Chapter AnnouncementOpenID Foundation Japan Chapter Announcement
OpenID Foundation Japan Chapter Announcement
 
MobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / GermanyMobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / Germany
 
Asce
AsceAsce
Asce
 
The Singles Lifecycle
The Singles LifecycleThe Singles Lifecycle
The Singles Lifecycle
 
Idenitifying the fit for perennial forage options in a crop-livestock system:...
Idenitifying the fit for perennial forage options in a crop-livestock system:...Idenitifying the fit for perennial forage options in a crop-livestock system:...
Idenitifying the fit for perennial forage options in a crop-livestock system:...
 
Lease Buyout Cost Reduction Six Sigma Case Study
Lease Buyout Cost Reduction Six Sigma Case StudyLease Buyout Cost Reduction Six Sigma Case Study
Lease Buyout Cost Reduction Six Sigma Case Study
 
Introduction to Continuous Delivery
Introduction to Continuous DeliveryIntroduction to Continuous Delivery
Introduction to Continuous Delivery
 
Geography of time and touchpoints time use planning 2012
Geography of time and touchpoints time use planning 2012Geography of time and touchpoints time use planning 2012
Geography of time and touchpoints time use planning 2012
 
KlikEyeDoc User Guide
KlikEyeDoc User GuideKlikEyeDoc User Guide
KlikEyeDoc User Guide
 
Resume Draft
Resume DraftResume Draft
Resume Draft
 
COH Online- The future of screening for distress in cancer settings (February11)
COH Online- The future of screening for distress in cancer settings (February11)COH Online- The future of screening for distress in cancer settings (February11)
COH Online- The future of screening for distress in cancer settings (February11)
 
30 Minute Expert1
30 Minute Expert130 Minute Expert1
30 Minute Expert1
 
Designing learning spaces to meet the changing needs and expectations of stud...
Designing learning spaces to meet the changing needs and expectations of stud...Designing learning spaces to meet the changing needs and expectations of stud...
Designing learning spaces to meet the changing needs and expectations of stud...
 
ASRR Keynote by Barry Dahl
ASRR Keynote by Barry DahlASRR Keynote by Barry Dahl
ASRR Keynote by Barry Dahl
 
STPCon Fall 2011
STPCon Fall 2011STPCon Fall 2011
STPCon Fall 2011
 
6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box Presentation6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box Presentation
 
PowerPoint Design
PowerPoint DesignPowerPoint Design
PowerPoint Design
 
Toolkit eleni katrini
Toolkit eleni katriniToolkit eleni katrini
Toolkit eleni katrini
 

Plus de Four Kitchens

Four Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMSFour Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMSFour Kitchens
 
Four Kitchens: We make BIG websites
Four Kitchens: We make BIG websitesFour Kitchens: We make BIG websites
Four Kitchens: We make BIG websitesFour Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)Four Kitchens
 
No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...Four Kitchens
 
Big Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case StudyBig Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case StudyFour Kitchens
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screenFour Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)Four Kitchens
 
Accelerated grid theming using NineSixty (DrupalCamp LA 2011)
Accelerated grid theming using NineSixty (DrupalCamp LA 2011)Accelerated grid theming using NineSixty (DrupalCamp LA 2011)
Accelerated grid theming using NineSixty (DrupalCamp LA 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)Four Kitchens
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalFour Kitchens
 
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)Four Kitchens
 
Designing future proof websites
Designing future proof websitesDesigning future proof websites
Designing future proof websitesFour Kitchens
 
Making drupal beautiful with web fonts
Making drupal beautiful with web fontsMaking drupal beautiful with web fonts
Making drupal beautiful with web fontsFour Kitchens
 
The type revolutionary's cookbook
The type revolutionary's cookbookThe type revolutionary's cookbook
The type revolutionary's cookbookFour Kitchens
 
The Web Chef Cookbook
The Web Chef CookbookThe Web Chef Cookbook
The Web Chef CookbookFour Kitchens
 

Plus de Four Kitchens (20)

Four Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMSFour Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMS
 
Four Kitchens: We make BIG websites
Four Kitchens: We make BIG websitesFour Kitchens: We make BIG websites
Four Kitchens: We make BIG websites
 
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
 
No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...
 
Big Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case StudyBig Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case Study
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screen
 
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
 
Accelerated grid theming using NineSixty (DrupalCamp LA 2011)
Accelerated grid theming using NineSixty (DrupalCamp LA 2011)Accelerated grid theming using NineSixty (DrupalCamp LA 2011)
Accelerated grid theming using NineSixty (DrupalCamp LA 2011)
 
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with Drupal
 
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Teaching Drupal
Teaching DrupalTeaching Drupal
Teaching Drupal
 
Big Websites
Big WebsitesBig Websites
Big Websites
 
Designing future proof websites
Designing future proof websitesDesigning future proof websites
Designing future proof websites
 
Making drupal beautiful with web fonts
Making drupal beautiful with web fontsMaking drupal beautiful with web fonts
Making drupal beautiful with web fonts
 
The type revolutionary's cookbook
The type revolutionary's cookbookThe type revolutionary's cookbook
The type revolutionary's cookbook
 
The Web Chef Cookbook
The Web Chef CookbookThe Web Chef Cookbook
The Web Chef Cookbook
 

Dernier

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Dernier (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Scalable Drupal infrastructure

  • 1. Designing, Scoping, and Configuring Scalable Drupal Infrastructure Presented 2009-05-30 by David Strauss
  • 3. Predicting peak traffic Traffic over the day can be highly irregular. To plan for peak loads, design as if all traffic were as heavy as the peak hour of load in a typical month -- and then plan for some growth.
  • 4. Analyzing hit distribution 40% 30% Hu man e nt nt 3% icC o 50% t Sta t en W t m eb rea al T Cr 100% ci aw pe s ou S le No r ym 10% on Dy n An am “P i cP ay W ag al l” es By pa ss 70% Auth entic ated 7% 20%
  • 5. Throughput vs. Delivery Methods Green Yellow Red (Static) (Dynamic, Cacheable) (Dynamic) 2 Content Delivery Network ●●●●●●●●●● ✖ ✖ Reverse Proxy Cache ●●●●●●● ●●●●●●● ✖ 1000 req/s 1 Drupal + Page Cache + memcached ●●● ●●● ✖ 1 Drupal + Page Cache ●●● ●● ✖ 1 Drupal ●●● ● ● 10 req/s 1 Delivered by Apache without Drupal More dots = More throughput 2 Some actually can do this.
  • 6. Objective Deliver hits using the fastest, most scalable method available.
  • 7. Layering: Less Traffic at Each Step Your Datacenter Load Reverse Application Traffic Balancer Proxy Server Cache DNS Round Robin CDN Database
  • 8. Offload from the master database Search Your master database is the single greatest limitation on scalability. Application Slave Server Database Master Memory Cache Database
  • 9. Tools to use ‣ Apache Solr for search. (Acquia offers hosting of this now.) ‣ Squid or Varnish for reverse proxy caching. ‣ Any third-party service for CDN.
  • 10. Do the math ‣ All non-CDN traffic travels through your load balancers and reverse proxy caches. Even traffic passed through to application servers must run through the initial layers. Load Reverse Application Traffic Balancer Proxy Server Cache What hit rate is each layer geing? How many servers share the load?
  • 11. Get a management/monitoring box Load (maybe two or three Balancer and have them specialized or redundant) Application Database Management Server Reverse Proxy Cache
  • 13. Infrastructure goals ‣ Redundancy ‣ Scalability ‣ Performance ‣ Manageability
  • 14. Redundancy ‣ When one server fails, the website should be able to recover without taking too long. ‣ This requires N+1, putting a floor on system requirements. ‣ How long can your site be down? ‣ Automatic versus manual failover
  • 15. Performance ‣ Find the “sweet spot” for hardware. This is the best price/performance point. ‣ Avoid overspending on any type of component ‣ Yet, avoid creating bottlenecks ‣ Swapping memory to disk is very dangerous
  • 16. Relative importance Processors/Cores Memory Disk Speed Reverse Proxy Cache ● ●●● ●● Web Server ●●●●● ●● ● Database Server ●● ●●●● ●●●● Monitoring ● ● ●
  • 17. Reverse proxy caches ‣ Squid makes poor use of multiple cores. Focus on getting the highest per-core performance. The best per-core performance is often on dual-core processors with high clock rates and lots of cache. ‣ Varnish is much more multithreaded. ‣ 4-8 GB memory, total ‣ Expect 1000 requests per second, per Squid ‣ 64-bit operating system if more than 2 GB RAM
  • 18. Web servers ‣ Apache 2.2 + mod_php + memcached ‣ Many processors + many cores is best ‣ 25 Apache threads per core ‣ 50 MB memory per thread, system-wide ‣ 1 GB memory for system ‣ 1 GB memory for memcached ‣ Configure MaxClients in Apache to maximum system-wide thread count ‣ Expect 1 request per thread, per second
  • 19. Database servers ‣ MySQL 5.0 cannot use more than eight cores effectively but gets good gains from at least quad- core processors. ‣ Depend on each Apache thread needing one connection, and add another 50. ‣ Each MySQL connection needs around 6 MB. ‣ MySQL with InnoDB needs a buffer pool large enough to cache all indexes. Start by giving the pool most remaining database server memory and working from there. ‣ 64-bit operating system if more than 2 GB RAM
  • 20. Monitoring server ‣ Very low hardware requirements ‣ Choose hardware that is inexpensive but essentially similar to the rest of the cluster to reduce management overhead ‣ Reliability and fast failover are typically low priorities for monitoring services
  • 21. Assembling the numbers ‣ Start with an architecture providing redundancy. ‣ Two servers, each running the whole stack ‣ Increase the number of proxy caches based on anonymous and search engine traffic. ‣ Increase the number of web servers based on authenticated traffic. ‣ Databases are harder to predict, but large sites should run them on at least two separate boxes with replication.
  • 22. Pressflow Make Drupal sites scale by upgrading core with a compatible, powerful replacement.
  • 23. Common large-site issues ‣ Drupal core requires patching to effectively support the advanced scalability techniques discussed here. ‣ Patches often conflict and have to be reapplied with each Drupal upgrade. ‣ The original patches are often unmaintained. ‣ Sites stagnate, running old, insecure versions of Drupal core because updating is too difficult.
  • 24. What is Pressflow? ‣ Pressflow is a derivative of Drupal core that integrates the most popular performance and scalability enhancements. ‣ Pressflow is completely compatible with existing Drupal 5 and 6 modules, both standard and custom. ‣ Pressflow installs as a drop-in replacement for standard Drupal. ‣ Pressflow is free as long as the matching version of Drupal is also supported by the community.
  • 25. What are the enhancements? ‣ Reverse proxy support ‣ Database replication support ‣ Lower database and session management load ‣ More efficient queries ‣ Testing and optimization by Four Kitchens with standard high-performance software and hardware configuration ‣ Industry-leading scalability support by Four Kitchens and Tag1 Consulting
  • 26. Four Kitchens + Tag1 ‣ Provide the development, support, scalability, and performance services behind Pressflow ‣ Comprise most members of the Drupal.org infrastructure team ‣ Have the most experience scaling Drupal sites of all sizes and all types
  • 27. Ready to scale? ‣ Learn more about Pressflow: ‣ Pick up pamphlets in the lobby ‣ Request Pressflow releases at fourkitchens.com ‣ Get the help you need to make it happen: ‣ Talk to me (David) or Todd here at DrupalCamp ‣ Email shout@fourkitchens.com
  • 29. The problem Soware and Configuration Application Application Application Application Application Server Server Server Server Server Objectives: Fast, atomic deployment and rollback Minimize single points of failure and contention Restart services Integrate with version control systems
  • 30. Manual updates and deployment Human Human Human Human Human Application Application Application Application Application Server Server Server Server Server Why not: slow deployment, non-atomic/difficult rollbacks
  • 31. Shared storage Application Application Application Application Application Server Server Server Server Server NFS Why not: single point of contention and failure
  • 32. rsync Synchronized with rsync Application Application Application Application Application Server Server Server Server Server Why not: non-atomic, does not manage services
  • 33. Capistrano Deployed with Capistrano Application Application Application Application Application Server Server Server Server Server Capistrano provides near-atomic deployment, service restarts, automated rollback, test automation, and version control integration (tagged releases).
  • 34. Multistage deployment Deployments Deployed with Deployed with Capistrano can be staged. Capistrano cap staging deploy cap production deploy Development Integration Deployed with Staging Capistrano Application Application Application Application Application Server Server Server Server Server
  • 35. But your application isn’t the only thing to manage.
  • 36. Beneath the application Reverse Cluster-level Proxy Database configuration Cache Application Application Application Application Application Server Server Server Server Server Cluster management applies to package management, updates, and soware configuration. cfengine and bcfg2 are popular cluster-level system configuration tools.
  • 37. System configuration management ‣ Deploys and updates packages, cluster-wide or selectively. ‣ Manages arbitrary text configuration files ‣ Analyzes inconsistent configurations (and converges them) ‣ Manages device classes (app. servers, database servers, etc.) ‣ Allows confident configuration testing on a staging server.
  • 38. All on the management box { Development Integration Staging Management Deployment Tools Monitoring
  • 40. Types of monitoring Failure Capacity/Load Analyzing Downtime Analyzing Trends Viewing Failover Predicting Load Troubleshooting Checking Results of Configuration and Notification Soware Changes
  • 42. What to use Failure/Uptime Capacity/Load Nagios Cacti Hyperic Munin
  • 43. Nagios ‣ Highly recommended. ‣ Used by Four Kitchens and Tag1 Consulting for client work, Drupal.org, Wikipedia, etc. ‣ Easy to install on CentOS 5 using EPEL packages. ‣ Easy to install nrpe agents to monitor diverse services. ‣ Can notify administrators on failure. ‣ We use this on Drupal.org
  • 44. Hyperic ‣ I haven’t used this much, but it’s fairly popular. ‣ More difficult to set up than Nagios.
  • 45. Cacti ‣ Highly annoying to set up. ‣ One instance generally collects all statistics. (No “agents” on the systems being monitored.) ‣ Provides flexible graphs that can be customized on demand. ‣ Optimized database for perpetual statistics collection. ‣ We use this on Drupal.org and for client sites.
  • 46. Munin ‣ Fairly easy to set up. ‣ One instance generally collects all statistics. (No “agents” on the systems being monitored.) ‣ Provides static graphs that cannot be customized.
  • 48. Cache/session coherency ‣ Systems that run properly on single boxes may lose coherency when run on a networked cluster. ‣ Some caches, like APC’s object cache, have no ability to handle network-level coherency. (APC’s opcode cache is safe to use on clusters.) ‣ memcached, if misconfigured, can hash values inconsistently across the cluster, resulting in different servers using different memcached instances for the same keys. ‣ Session coherency can be helped with load balancer affinity.
  • 49. Cache regeneration races ‣ Downside to network cache coherency: synched expiration ‣ Hard to solve All servers regenerating the item. Old Cached Item Expiration { New Cached Item Time
  • 50. Broken replication ‣ MySQL slave servers get out of synch, fall further behind ‣ No means of automated recovery ‣ Only solvable with good monitoring and recovery procedures ‣ Can automate removal from use, but requires cluster management tools
  • 51. Server failure ‣ Load balancers can remove broken or overloaded application reverse proxy caches. ‣ Reverse proxy caches like Varnish can automatically use only functional application servers. ‣ Cluster management tools like heartbeat2 can manage service IPs on MySQL servers to automate failover. ‣ Conclusion: Each layer intelligently monitors and uses the servers beneath it.
  • 52. All content in this presentation, except where noted otherwise, is Creative Commons Attribution- ShareAlike 3.0 licensed and copyright 2009 Four Kitchen Studios, LLC.