SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
Оптимизируем 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

Más contenido relacionado

La actualidad más candente

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
 
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)
jeresig
 
Fringe eu procurement - sara piller
Fringe   eu procurement - sara pillerFringe   eu procurement - sara piller
Fringe eu procurement - sara piller
lgconf11
 
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
sustainablenw
 
KlikEyeDoc User Guide
KlikEyeDoc User GuideKlikEyeDoc User Guide
KlikEyeDoc User Guide
Manohar Vijay
 
Conversation Clusters: Grouping Conversation Through Human Computer Dialog
Conversation Clusters: Grouping Conversation Through Human Computer DialogConversation Clusters: Grouping Conversation Through Human Computer Dialog
Conversation Clusters: Grouping Conversation Through Human Computer Dialog
Tony Bergstrom
 

La actualidad más candente (20)

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...
 
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)
 
Fringe eu procurement - sara piller
Fringe   eu procurement - sara pillerFringe   eu procurement - sara piller
Fringe eu procurement - sara piller
 
IAPT10 - Detecting depression - an update (June10)
IAPT10 - Detecting depression - an update (June10)IAPT10 - Detecting depression - an update (June10)
IAPT10 - Detecting depression - an update (June10)
 
Ivesco feline vaccine comparison chart 2011
Ivesco feline vaccine comparison chart 2011Ivesco feline vaccine comparison chart 2011
Ivesco feline vaccine comparison chart 2011
 
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
When Ranching Is For The Birds (And Fish And Elk), Ranchland Ownership Change...
 
Polyhex Tree of Life - A1 Color Poster
Polyhex Tree of Life - A1 Color PosterPolyhex Tree of Life - A1 Color Poster
Polyhex Tree of Life - A1 Color Poster
 
SIAT Space
SIAT SpaceSIAT Space
SIAT Space
 
12 Lessons from the B2B Marketing Manifesto Campaign
12 Lessons from the B2B Marketing Manifesto Campaign12 Lessons from the B2B Marketing Manifesto Campaign
12 Lessons from the B2B Marketing Manifesto Campaign
 
jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)
 
Family Events Leaflet at the Herbert 2011
Family Events Leaflet at the Herbert 2011Family Events Leaflet at the Herbert 2011
Family Events Leaflet at the Herbert 2011
 
Measuring Social Media
Measuring Social MediaMeasuring Social Media
Measuring Social Media
 
120125 tridti p2_resized
120125 tridti p2_resized120125 tridti p2_resized
120125 tridti p2_resized
 
Still Fab
Still FabStill Fab
Still Fab
 
KlikEyeDoc User Guide
KlikEyeDoc User GuideKlikEyeDoc User Guide
KlikEyeDoc User Guide
 
Domagoj Margetic
Domagoj MargeticDomagoj Margetic
Domagoj Margetic
 
Seo in-singapore
Seo in-singaporeSeo in-singapore
Seo in-singapore
 
Seo conferences-2011
Seo conferences-2011Seo conferences-2011
Seo conferences-2011
 
test 2
test 2 test 2
test 2
 
Conversation Clusters: Grouping Conversation Through Human Computer Dialog
Conversation Clusters: Grouping Conversation Through Human Computer DialogConversation Clusters: Grouping Conversation Through Human Computer Dialog
Conversation Clusters: Grouping Conversation Through Human Computer Dialog
 

Destacado

Ubercart7 views catalog ru
Ubercart7 views catalog ruUbercart7 views catalog ru
Ubercart7 views catalog ru
Andrii Podanenko
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
camp_drupal_ua
 

Destacado (13)

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

Similar a Drupal Optimization

MobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / GermanyMobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / Germany
Avenga Germany GmbH
 
EBG206/306 Business Communication Tools
EBG206/306 Business Communication ToolsEBG206/306 Business Communication Tools
EBG206/306 Business Communication Tools
Chris Hall
 
Dave Folio G D 8
Dave Folio  G D 8Dave Folio  G D 8
Dave Folio G D 8
Dave Lilly
 
30 Minute Expert1
30 Minute Expert130 Minute Expert1
30 Minute Expert1
Ben Wilkoff
 

Similar a Drupal Optimization (20)

Scalable Drupal Infrastructure
Scalable Drupal InfrastructureScalable Drupal Infrastructure
Scalable Drupal Infrastructure
 
Scalable Drupal infrastructure
Scalable Drupal infrastructureScalable Drupal infrastructure
Scalable Drupal infrastructure
 
OpenID Foundation Japan Chapter Announcement
OpenID Foundation Japan Chapter AnnouncementOpenID Foundation Japan Chapter Announcement
OpenID Foundation Japan Chapter Announcement
 
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
 
MobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / GermanyMobileTechCon 2011 Mainz / Germany
MobileTechCon 2011 Mainz / Germany
 
Developing and Assessing Teacher Effectiveness
Developing and Assessing Teacher EffectivenessDeveloping and Assessing Teacher Effectiveness
Developing and Assessing Teacher Effectiveness
 
Open Source Success: jQuery
Open Source Success: jQueryOpen Source Success: jQuery
Open Source Success: jQuery
 
Asce
AsceAsce
Asce
 
EBG206/306 Business Communication Tools
EBG206/306 Business Communication ToolsEBG206/306 Business Communication Tools
EBG206/306 Business Communication Tools
 
Designing for Disruption
Designing for DisruptionDesigning for Disruption
Designing for Disruption
 
Creative Workshop Teacher's Guide
Creative Workshop Teacher's GuideCreative Workshop Teacher's Guide
Creative Workshop Teacher's Guide
 
Enterprise Collaboration: Can You Connect Social Learning and Business Perfor...
Enterprise Collaboration: Can You Connect Social Learning and Business Perfor...Enterprise Collaboration: Can You Connect Social Learning and Business Perfor...
Enterprise Collaboration: Can You Connect Social Learning and Business Perfor...
 
Watershed
WatershedWatershed
Watershed
 
Srs
SrsSrs
Srs
 
Srs
SrsSrs
Srs
 
Dave Folio
Dave FolioDave Folio
Dave Folio
 
Dave Folio G D 8
Dave Folio  G D 8Dave Folio  G D 8
Dave Folio G D 8
 
Cold frame
Cold frameCold frame
Cold frame
 
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
 

Más de Andrii Podanenko

Глобальні навчальні дні друпал
Глобальні навчальні дні друпалГлобальні навчальні дні друпал
Глобальні навчальні дні друпал
Andrii Podanenko
 
Ubercart7 Dynamic properties ru
Ubercart7 Dynamic properties ruUbercart7 Dynamic properties ru
Ubercart7 Dynamic properties ru
Andrii Podanenko
 
Yaremchuk - Drupal CodeLobster
Yaremchuk - Drupal CodeLobsterYaremchuk - Drupal CodeLobster
Yaremchuk - Drupal CodeLobster
Andrii Podanenko
 
Yaremchuk - Корпоративные сайты
Yaremchuk - Корпоративные сайтыYaremchuk - Корпоративные сайты
Yaremchuk - Корпоративные сайты
Andrii Podanenko
 

Más de Andrii Podanenko (18)

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

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer 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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 

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 : akhodakovskiy@adyax.com
  • 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 : akhodakovskiy@adyax.com Оптимизируем Drupal. Aleksey Khodakovskiy DrupalCamp Kyiv 2010