SlideShare a Scribd company logo
Оптимизируем Drupal
                                Aleksey Khodakovskiy
                                               Adyax
                  38 rue N-D De Nazareth, 75003 Paris
Ligne directe :                     +33 1 76 77 34 65
Standard :                          +33 1 76 77 34 60
Mobile :                            +33 6 37 47 45 83
Email :                    akhodakovskiy@adyax.com
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.




    David Strauss

Wed 2010-06-09



                                         Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Analyzing hit distribution
                                                                                                   40%
                                        30%                                  a      n
                                    t                                  H  um
                                 en
                               nt
                             Co                        50%                                                                  3%
                        ic
                     at
                  St                                                                                             me
                                                                                                                    n  t
                                                                                                              at
                                                                                                          Tre




                                                             W wl
                                                             C
 100%                                                                                                   l




                                                              eb er
                                                               ra
                                                                                                      ia




                                                   s
                                                                                                    c
                                                                                                 pe

                                              ou
                                                                                               S
                                                                                          No
                                              m
                                                                             10%
                                            ny
                 Dy ag




                                         no


                                                                                               “Pay
                   na es




                                                                                                    W
                   P




                                                                                                Byp all”
                                        A
                     m




                                                                                                    ass
                                                                                                                        7%
                      ic




                                  70%
                                          Auth
                                               entica
                                                     ted
                                                            20%
    David Strauss

Wed 2010-06-09



                                                           Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Throughput vs. Delivery Methods
                                                       Yellow
                                Green                                                 Red
                                                     (Dynamic,
                               (Static)                                            (Dynamic)
                                                     Cacheable)
     Content Delivery
                                                                       2

        Network
                        ●●●●●●●●●●                       ✖                                 ✖
        Reverse Proxy
           Cache
                        ●●●●●●●●                ●●●●●●●                                    ✖
                                   5000 req/s

         PHP + APC +                      1
                        ●●●●                    ●●●                           ●●●
         memcached

                                          1
          PHP + APC     ●●●●                    ●●                            ●●


                                          1
       PHP (No APC)     ●●●●                    ●                             ●
                                                                                                   10 req/s

                                                1   Delivered by Apache without PHP
     More dots = More throughput                2   Some actually can do this.
    David Strauss

Wed 2010-06-09



                                                              Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Layering: Less Traffic at Each Step

                    Your Datacenter



                      Load                Reverse
        Traffic                              Proxy                                    Application
                     Balancer              Cache                                      Server


                      DNS Round Robin


          CDN                                                                       Database



    David Strauss

Wed 2010-06-09



                                 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Offload from the master database
                     Search       Your master database is the
                                  single greatest limitation on
                                  scalability.


                    Application         Slave
                      Server           Database




                                     Master
                    Memory
                     Cache
                                    Database



    David Strauss

Wed 2010-06-09



                                                  Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Relative importance
                              Processors/Cores             Memory                             Disk Speed


           Reverse Proxy
              Cache           ●●                    ●●●                                   ●●

             Web Server       ●●●●●                 ●●                                    ●

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

                 Monitoring   ●                     ●                                     ●



    David Strauss

Wed 2010-06-09



                                                 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
All of your servers
     ‣   64-bit: no excuse to use anything less in 2010
     ‣   RHEL/CentOS and Ubuntu have the broadest
         adoption for large-scale LAMP
          ‣   But pick one, and stick with it for development,
              staging, and production
     ‣   Some disk redundancy: rebuilding a server
         is time-consuming unless you’re very automated


    David Strauss

Wed 2010-06-09



                                            Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Reverse proxy caches
     ‣   Varnish and nginx have modern architecture and
         broad adoption
          ‣   Sites often front Varnish with nginx
              for gzip and/or SSL
     ‣   Squid and Traffic Server are clunky
         but reliable alternatives



                       +                                           +
                 CPU              Memory                                                      Disk

                              1 GB base system                                         Slow
         Save Your
                             + 3 GB for caching                                       + Small
          Money
                                                                                   + Redundant



    David Strauss
                        = 5000 req/s
Wed 2010-06-09



                                     Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Web servers
     ‣ Apache 2.2 + mod_php + memcached
     ‣ FastCGI is a bad idea
          ‣   Memory improvements are redundant w/ Varnish
        Higher latency + less efficient with APC opcode
          ‣
     ‣ Check the memory your app takes per process
     ‣    Tune MaxClients to around 25 × cores



                             +                              +
           CPU                         Memory                                          Disk
          Max out                  1 GB base system                             Slow
           cores                  + 1 GB memcached                             + Small
          (but prefer fast
         cores to density)
                                  + 25 × cores × per-                       + Redundant
                                 process app memory


    David Strauss            = 100 req/s
Wed 2010-06-09



                                                   Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Database servers
    ‣   Insist on MySQL 5.1+ and InnoDB
    ‣   Consider Percona builds and (eventually) MariaDB
    ‣   Every Apache process generally needs at least one
        connection available, and leave some headroom
    ‣   Tune the InnoDB buffer pool to at least half of RAM



                       +                                          +
                 CPU               Memory                                                    Disk
         No more             As much as you can                                        Fast
         than 8-12          afford (even RAM not                                      + Large
           cores           used by MySQL caches                                   + Redundant
                                disk content)


    David Strauss      = 3000 queries/s
Wed 2010-06-09



                                    Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
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.
    David Strauss

Wed 2010-06-09



                                           Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Offline processing
     ‣   Gearman
          ‣   Primarily asynchronous job manager
     ‣   Hadoop
          ‣   MapReduce framework
     ‣   Traditional message queues
          ‣   ActiveMQ + Stomp is easy from PHP
          ‣   Allows you to build your own job manager

    David Strauss

Wed 2010-06-09



                                    Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Edge-side includes
      <html>
      <body>
                                                                  ‣   Blocks of HTML are
         <esi:include href=“http://drupal.org/block/views/3” />
      </body>
                                                                      integrated into the
      </html>
                                                                      page at the edge
                                                                      layer.
                                           <div>
             ESI Processor
        (Varnish, Akamai, other)
                                              My block HTML.
                                           </div>
                                                                  ‣   Non-primary page
                                                                      content often
                                                                      occupies >50% of
        <html>                                                        PHP execution time.
        <body>
           <div>
              My block HTML.                                      ‣   Decouples block
           </div>
        </body>                                                       and page cache
        </html>
                                                                      lifetimes

Wed 2010-06-09



                                                                       Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
HipHop PHP
     ‣   Compiles PHP to a C++-based binary
          ‣   Integrated HTTP server
     ‣   Supports a subset of PHP and extensions
     ‣   Requires an organizational commitment to
         building, testing, and deploying on HipHop
     ‣   Scott MacVicar has a presentation on HipHop later
         today at 16:00.


    David Strauss

Wed 2010-06-09



                                   Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Оптимизируем Друпал (Pressflow):
               https://launchpad.net/pressflow
что уже разработано и внедрено:
* Lazy session creation (no sessions for anonymous users)
* Fast access checks (access denied slow query)
* Database repli cation (master/slave)
* External page cache (reverse proxy support)
* Fast path alias detection (drupal_lookup_path() optimization)
* Native JSON encoding
в скором будущем будет внедрено: https://blueprints.
launchpad.net/pressflow
* Path caching
* Distributed menu tree generation and caching
* HipHop PHP


                                       Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Сравнение Pressflow с разными
          версиями Drupal:

https://wiki.fourkitchens.com/display/PF/Comparison+-+Pressflow+versus+Drupal




                                     Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Caching: Modules that make
       Drupal scale:

http://groups.drupal.org/node/21897




                       Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Tuning:
APC: https://wiki.fourkitchens.com/display/PF/Tuning+APC


                             DB:
  * Indexes: http://groups.drupal.org/node/57213
  via module: http://drupal.org/project/dbtuner
  * MySQL оптимизация: http://drupal.org/node/85768
  * MySQL for Drupal: http://drupal.org/node/51263
  * MyISAM -> InnoDB if SELECTs
                  are blocked by INSERTs/UPDATEs
  * partitioning, memory tables


                                Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
Front end optimisation modules:
http://groups.drupal.org/node/57563
http://drupal.org/node/266179 -> Comparison of CSS Preprocessors


                     Решения:
Boost + Nginx (может быть использовам вместо Apache) для
анонимного трафика

                     Authcach:
+ Memcached для авторизированного трафика
+ Boost для анонимного трафика



                                         Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
=================================
All about optimization: http://drupal.org/node/326504
=================================
Drupal Group: High performance:
http://groups.drupal.org/high-performance
при подготовке доклада использованы материалы,
представленные David Strauss
на DrupalCamp Stockholm (May 19, 2010).
--------------------------------------------------
Aleksey Khodakovskiy
Adyax
38 rue N-D De Nazareth, 75003 Paris
Ligne directe :        +33 1 76 77 34 65
Standard : +33 1 76 77 34 60
Mobile :          +33 6 37 47 45 83
Email :       akhodakovskiy@adyax.com
                               Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010

More Related Content

What's hot (20)

PDF
Designing learning spaces to meet the changing needs and expectations of stud...
Dan Munnerley
 
PDF
jQuery Open Source Process (RIT 2011)
jeresig
 
PPT
Fringe eu procurement - sara piller
lgconf11
 
PDF
IAPT10 - Detecting depression - an update (June10)
Alex J Mitchell
 
PDF
Ivesco feline vaccine comparison chart 2011
Heartland Veterinary Supply & Pharmacy
 
PDF
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
sustainablenw
 
PDF
Polyhex Tree of Life - A1 Color Poster
AstroQab
 
PDF
SIAT Space
Nate1066
 
PDF
12 Lessons from the B2B Marketing Manifesto Campaign
Velocity Partners
 
PDF
jQuery Open Source (Fronteer 2011)
jeresig
 
PDF
Family Events Leaflet at the Herbert 2011
Jamie Perry
 
PPT
Measuring Social Media
Dave Evans
 
PDF
120125 tridti p2_resized
Tridti Patarakiatsan
 
PDF
Still Fab
TomRaski
 
PDF
KlikEyeDoc User Guide
Manohar Vijay
 
PDF
Domagoj Margetic
Emil Čić
 
PDF
Seo in-singapore
Vinalink Media JSC
 
PDF
Seo conferences-2011
Vinalink Media JSC
 
PDF
test 2
SZAIDI04
 
PDF
Conversation Clusters: Grouping Conversation Through Human Computer Dialog
Tony Bergstrom
 
Designing learning spaces to meet the changing needs and expectations of stud...
Dan Munnerley
 
jQuery Open Source Process (RIT 2011)
jeresig
 
Fringe eu procurement - sara piller
lgconf11
 
IAPT10 - Detecting depression - an update (June10)
Alex J Mitchell
 
Ivesco feline vaccine comparison chart 2011
Heartland Veterinary Supply & Pharmacy
 
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
sustainablenw
 
Polyhex Tree of Life - A1 Color Poster
AstroQab
 
SIAT Space
Nate1066
 
12 Lessons from the B2B Marketing Manifesto Campaign
Velocity Partners
 
jQuery Open Source (Fronteer 2011)
jeresig
 
Family Events Leaflet at the Herbert 2011
Jamie Perry
 
Measuring Social Media
Dave Evans
 
120125 tridti p2_resized
Tridti Patarakiatsan
 
Still Fab
TomRaski
 
KlikEyeDoc User Guide
Manohar Vijay
 
Domagoj Margetic
Emil Čić
 
Seo in-singapore
Vinalink Media JSC
 
Seo conferences-2011
Vinalink Media JSC
 
test 2
SZAIDI04
 
Conversation Clusters: Grouping Conversation Through Human Computer Dialog
Tony Bergstrom
 

Viewers also liked (13)

PPTX
Drupal 8 configuration development flow
Andrii Podanenko
 
PDF
Feeds drupal cafe
Andrii Podanenko
 
PDF
Ubercart7 views catalog ru
Andrii Podanenko
 
PDF
Docker SQL Continuous Integration Flow
Andrii Podanenko
 
PDF
Drupal codesprint kyiv drupal cafe 07.02.2013
Andrii Podanenko
 
PDF
Do + ldo for developers(full)
Andrii Podanenko
 
PDF
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 
PDF
Live deployment, ci, drupal
Andrii Podanenko
 
PDF
Drupal contrib module maintaining
Andrii Podanenko
 
PDF
Start using vagrant now!
Andrii Podanenko
 
PPTX
Drupal Continuous Integration Workflow
Andrii Podanenko
 
PPTX
природна і економна дорожня карта для переходу команди розробки на тест центр...
Andrii Podanenko
 
PPTX
MoldCamp - multidimentional testing workflow. CIBox.
Andrii Podanenko
 
Drupal 8 configuration development flow
Andrii Podanenko
 
Feeds drupal cafe
Andrii Podanenko
 
Ubercart7 views catalog ru
Andrii Podanenko
 
Docker SQL Continuous Integration Flow
Andrii Podanenko
 
Drupal codesprint kyiv drupal cafe 07.02.2013
Andrii Podanenko
 
Do + ldo for developers(full)
Andrii Podanenko
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Live deployment, ci, drupal
Andrii Podanenko
 
Drupal contrib module maintaining
Andrii Podanenko
 
Start using vagrant now!
Andrii Podanenko
 
Drupal Continuous Integration Workflow
Andrii Podanenko
 
природна і економна дорожня карта для переходу команди розробки на тест центр...
Andrii Podanenko
 
MoldCamp - multidimentional testing workflow. CIBox.
Andrii Podanenko
 
Ad

Similar to Drupal Optimization (20)

PDF
Scalable Drupal infrastructure
Four Kitchens
 
PDF
Scalable Drupal Infrastructure
David Timothy Strauss
 
PDF
OpenID Foundation Japan Chapter Announcement
David Recordon
 
PDF
Lease Buyout Cost Reduction Six Sigma Case Study
Steven Bonacorsi
 
PDF
MobileTechCon 2011 Mainz / Germany
Avenga Germany GmbH
 
PDF
Open Source Success: jQuery
jeresig
 
PPTX
EBG206/306 Business Communication Tools
Chris Hall
 
PDF
Designing for Disruption
Marisa Gallagher
 
KEY
Mobile Learning Readiness in the Swiss Armed Forces
Christian Glahn
 
PPTX
2012 Apscu Cross Lanaghen Revised 6 5 2012
Ann Cross
 
PDF
Enterprise Collaboration: Can You Connect Social Learning and Business Perfor...
Human Capital Media
 
PDF
Watershed
Voscur Staff
 
PPTX
Srs
Nancy Munce
 
PPTX
Srs
Nancy Munce
 
PDF
Dave Folio
Dave Lilly
 
PDF
Dave Folio G D 8
Dave Lilly
 
PDF
Cold frame
Gherghescu Gabriel
 
PDF
COH Online- The future of screening for distress in cancer settings (February11)
Alex J Mitchell
 
Scalable Drupal infrastructure
Four Kitchens
 
Scalable Drupal Infrastructure
David Timothy Strauss
 
OpenID Foundation Japan Chapter Announcement
David Recordon
 
Lease Buyout Cost Reduction Six Sigma Case Study
Steven Bonacorsi
 
MobileTechCon 2011 Mainz / Germany
Avenga Germany GmbH
 
Open Source Success: jQuery
jeresig
 
EBG206/306 Business Communication Tools
Chris Hall
 
Designing for Disruption
Marisa Gallagher
 
Mobile Learning Readiness in the Swiss Armed Forces
Christian Glahn
 
2012 Apscu Cross Lanaghen Revised 6 5 2012
Ann Cross
 
Enterprise Collaboration: Can You Connect Social Learning and Business Perfor...
Human Capital Media
 
Watershed
Voscur Staff
 
Dave Folio
Dave Lilly
 
Dave Folio G D 8
Dave Lilly
 
Cold frame
Gherghescu Gabriel
 
COH Online- The future of screening for distress in cancer settings (February11)
Alex J Mitchell
 
Ad

More from Andrii Podanenko (18)

PDF
Глобальні навчальні дні друпал
Andrii Podanenko
 
PDF
Головні Принципи Автоматизації
Andrii Podanenko
 
PDF
Drupal 8 DevOps . Profile and SQL flows.
Andrii Podanenko
 
PDF
CIbox - OpenSource solution for making your #devops better
Andrii Podanenko
 
PDF
DrupalCon Los Angeles - Continuous Integration Toolbox
Andrii Podanenko
 
PDF
Сейчас самое время...ЖИТЬ!
Andrii Podanenko
 
PDF
Drupal 8 what to wait from
Andrii Podanenko
 
PDF
Диалоговый интенсив 2012 карпаты
Andrii Podanenko
 
PDF
психолог в социальных медиа
Andrii Podanenko
 
PDF
Ubercart7 Dynamic properties ru
Andrii Podanenko
 
ODP
Ubercart 7 ru
Andrii Podanenko
 
PDF
Drupal 7 database api
Andrii Podanenko
 
PDF
Yaremchuk - Drupal CodeLobster
Andrii Podanenko
 
PDF
Yaremchuk - Корпоративные сайты
Andrii Podanenko
 
PDF
управление проектами отношение к клиенту
Andrii Podanenko
 
PDF
Друпал - стандартні модулі
Andrii Podanenko
 
PDF
Друпал Drush
Andrii Podanenko
 
PPT
Drupal Migrate
Andrii Podanenko
 
Глобальні навчальні дні друпал
Andrii Podanenko
 
Головні Принципи Автоматизації
Andrii Podanenko
 
Drupal 8 DevOps . Profile and SQL flows.
Andrii Podanenko
 
CIbox - OpenSource solution for making your #devops better
Andrii Podanenko
 
DrupalCon Los Angeles - Continuous Integration Toolbox
Andrii Podanenko
 
Сейчас самое время...ЖИТЬ!
Andrii Podanenko
 
Drupal 8 what to wait from
Andrii Podanenko
 
Диалоговый интенсив 2012 карпаты
Andrii Podanenko
 
психолог в социальных медиа
Andrii Podanenko
 
Ubercart7 Dynamic properties ru
Andrii Podanenko
 
Ubercart 7 ru
Andrii Podanenko
 
Drupal 7 database api
Andrii Podanenko
 
Yaremchuk - Drupal CodeLobster
Andrii Podanenko
 
Yaremchuk - Корпоративные сайты
Andrii Podanenko
 
управление проектами отношение к клиенту
Andrii Podanenko
 
Друпал - стандартні модулі
Andrii Podanenko
 
Друпал Drush
Andrii Podanenko
 
Drupal Migrate
Andrii Podanenko
 

Recently uploaded (20)

PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 

Drupal Optimization

  • 1. Оптимизируем Drupal Aleksey Khodakovskiy Adyax 38 rue N-D De Nazareth, 75003 Paris Ligne directe : +33 1 76 77 34 65 Standard : +33 1 76 77 34 60 Mobile : +33 6 37 47 45 83 Email : [email protected]
  • 2. 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. David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 3. Analyzing hit distribution 40% 30% a n t H um en nt Co 50% 3% ic at St me n t at Tre W wl C 100% l eb er ra ia s c pe ou S No m 10% ny Dy ag no “Pay na es W P Byp all” A m ass 7% ic 70% Auth entica ted 20% David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 4. Throughput vs. Delivery Methods Yellow Green Red (Dynamic, (Static) (Dynamic) Cacheable) Content Delivery 2 Network ●●●●●●●●●● ✖ ✖ Reverse Proxy Cache ●●●●●●●● ●●●●●●● ✖ 5000 req/s PHP + APC + 1 ●●●● ●●● ●●● memcached 1 PHP + APC ●●●● ●● ●● 1 PHP (No APC) ●●●● ● ● 10 req/s 1 Delivered by Apache without PHP More dots = More throughput 2 Some actually can do this. David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 5. Layering: Less Traffic at Each Step Your Datacenter Load Reverse Traffic Proxy Application Balancer Cache Server DNS Round Robin CDN Database David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 6. Offload from the master database Search Your master database is the single greatest limitation on scalability. Application Slave Server Database Master Memory Cache Database David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 7. Relative importance Processors/Cores Memory Disk Speed Reverse Proxy Cache ●● ●●● ●● Web Server ●●●●● ●● ● Database Server ●●● ●●●● ●●●● Monitoring ● ● ● David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 8. All of your servers ‣ 64-bit: no excuse to use anything less in 2010 ‣ RHEL/CentOS and Ubuntu have the broadest adoption for large-scale LAMP ‣ But pick one, and stick with it for development, staging, and production ‣ Some disk redundancy: rebuilding a server is time-consuming unless you’re very automated David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 9. Reverse proxy caches ‣ Varnish and nginx have modern architecture and broad adoption ‣ Sites often front Varnish with nginx for gzip and/or SSL ‣ Squid and Traffic Server are clunky but reliable alternatives + + CPU Memory Disk 1 GB base system Slow Save Your + 3 GB for caching + Small Money + Redundant David Strauss = 5000 req/s Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 10. Web servers ‣ Apache 2.2 + mod_php + memcached ‣ FastCGI is a bad idea ‣ Memory improvements are redundant w/ Varnish Higher latency + less efficient with APC opcode ‣ ‣ Check the memory your app takes per process ‣ Tune MaxClients to around 25 × cores + + CPU Memory Disk Max out 1 GB base system Slow cores + 1 GB memcached + Small (but prefer fast cores to density) + 25 × cores × per- + Redundant process app memory David Strauss = 100 req/s Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 11. Database servers ‣ Insist on MySQL 5.1+ and InnoDB ‣ Consider Percona builds and (eventually) MariaDB ‣ Every Apache process generally needs at least one connection available, and leave some headroom ‣ Tune the InnoDB buffer pool to at least half of RAM + + CPU Memory Disk No more As much as you can Fast than 8-12 afford (even RAM not + Large cores used by MySQL caches + Redundant disk content) David Strauss = 3000 queries/s Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 12. 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. David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 13. Offline processing ‣ Gearman ‣ Primarily asynchronous job manager ‣ Hadoop ‣ MapReduce framework ‣ Traditional message queues ‣ ActiveMQ + Stomp is easy from PHP ‣ Allows you to build your own job manager David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 14. Edge-side includes <html> <body> ‣ Blocks of HTML are <esi:include href=“http://drupal.org/block/views/3” /> </body> integrated into the </html> page at the edge layer. <div> ESI Processor (Varnish, Akamai, other) My block HTML. </div> ‣ Non-primary page content often occupies >50% of <html> PHP execution time. <body> <div> My block HTML. ‣ Decouples block </div> </body> and page cache </html> lifetimes Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 15. HipHop PHP ‣ Compiles PHP to a C++-based binary ‣ Integrated HTTP server ‣ Supports a subset of PHP and extensions ‣ Requires an organizational commitment to building, testing, and deploying on HipHop ‣ Scott MacVicar has a presentation on HipHop later today at 16:00. David Strauss Wed 2010-06-09 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 16. Оптимизируем Друпал (Pressflow): https://launchpad.net/pressflow что уже разработано и внедрено: * Lazy session creation (no sessions for anonymous users) * Fast access checks (access denied slow query) * Database repli cation (master/slave) * External page cache (reverse proxy support) * Fast path alias detection (drupal_lookup_path() optimization) * Native JSON encoding в скором будущем будет внедрено: https://blueprints. launchpad.net/pressflow * Path caching * Distributed menu tree generation and caching * HipHop PHP Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 17. Сравнение Pressflow с разными версиями Drupal: https://wiki.fourkitchens.com/display/PF/Comparison+-+Pressflow+versus+Drupal Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 18. Caching: Modules that make Drupal scale: http://groups.drupal.org/node/21897 Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 19. Tuning: APC: https://wiki.fourkitchens.com/display/PF/Tuning+APC DB: * Indexes: http://groups.drupal.org/node/57213 via module: http://drupal.org/project/dbtuner * MySQL оптимизация: http://drupal.org/node/85768 * MySQL for Drupal: http://drupal.org/node/51263 * MyISAM -> InnoDB if SELECTs are blocked by INSERTs/UPDATEs * partitioning, memory tables Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 20. Front end optimisation modules: http://groups.drupal.org/node/57563 http://drupal.org/node/266179 -> Comparison of CSS Preprocessors Решения: Boost + Nginx (может быть использовам вместо Apache) для анонимного трафика Authcach: + Memcached для авторизированного трафика + Boost для анонимного трафика Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010
  • 21. ================================= All about optimization: http://drupal.org/node/326504 ================================= Drupal Group: High performance: http://groups.drupal.org/high-performance при подготовке доклада использованы материалы, представленные David Strauss на DrupalCamp Stockholm (May 19, 2010). -------------------------------------------------- Aleksey Khodakovskiy Adyax 38 rue N-D De Nazareth, 75003 Paris Ligne directe : +33 1 76 77 34 65 Standard : +33 1 76 77 34 60 Mobile : +33 6 37 47 45 83 Email : [email protected] Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010