SlideShare a Scribd company logo
Tuning Your Engine
      Joel Bradbury
I’m Joel Bradbury
               @joelbradbury




                               View Creative
I’m the lead developer at
                            viewcreative.co.uk
What we can tune
The tuning options
The tuning options
The Server
(Apache etc.)




  The tuning options
The Server      Extra magic dust
(Apache etc.)      (squid cache,
                load balancers etc.)



  The tuning options
The Server      Your Site     Extra magic dust
(Apache etc.)   (EE for us)      (squid cache,
                              load balancers etc.)



  The tuning options
The Server      Your Site     Extra magic dust
(Apache etc.)   (EE for us)      (squid cache,
                              load balancers etc.)



  The tuning options
The tuning options
The html




  The tuning options
The html        The EE
               & CI Core



  The tuning options
The html        OUR          The EE
           implementation   & CI Core



  The tuning options
The html        OUR          The EE
           implementation   & CI Core



  The tuning options
Performance
Performance


•Why it matters
Performance


•Why it matters
•Why it’s an issue
Performance


•Why it matters
•Why it’s an issue

•What we can do about it
Why it matters

A user’s overall site experience
 will be set by the worst part
Why it’s an issue
Why it’s an issue
especially for ExpressionEngine
Flexibility
Flexibility
  costs
What we can do about it
What we can do about it
     Tune it to hell and back
What can we tune?
What can we tune?

•Site Baseline - disable what you don’t need
What can we tune?

•Site Baseline - disable what you don’t need
•Data Structure - you know your data best
What can we tune?

•Site Baseline - disable what you don’t need
•Data Structure - you know your data best

•Addons - the black boxes in the system
What can we tune?

•Site Baseline - disable what you don’t need
•Data Structure - you know your data best

•Addons - the black boxes in the system

•Templates - the devil is in the details
Metrics
    If we’re going to tune it,
we’ve got to be able to measure it
Turn them on




Admin > System Administration > Output and Debugging
Output Profiler
Output Profiler
Output Profiler
15



Output Profiler
Template Logging
Template Logging
Template Graph
Time




       Template Graph
Time



         Template execution


       Template Graph
End Metrics
End Metrics


      15


Database queries
End Metrics


      15


Database queries   Execution Profile
End Metrics


      15


Database queries                      Execution Profile
           * take all numbers/times as guides only.
                        yours will differ
Metrics - baselines
Clean Template


Literally this :
Clean Template


Literally this :
Clean Template
Clean Template


 6-8


Queries
Clean Template


 6-8


Queries     Execution profile
What’s happening?
What’s happening?
What’s happening?
What’s happening?
What’s happening?
What’s happening?
What’s happening?
What’s happening?
What’s happening?
(0.008751) Template Parsing Finished




 Keeping it in context
The interesting bit
The interesting bit
Templates
Templates - loops
Loops can kill
Loops can kill
   your performance
Loops can kill
   your performance
     but only if you’re sloppy
The Cost of a Loop
 using channel:entries as an example



  {exp:channel:entries
     dynamic=“no”
     channel=“example”
     limit=“1”} ...
The Cost of a Loop
 using channel:entries as an example




               clean template
The Cost of a Loop
 using channel:entries as an example




               loop template
The Cost of a Loop
 using channel:entries as an example




               loop template
The Cost of a Loop
 using channel:entries as an example
The Cost of a Loop
 using channel:entries as an example
The Cost of a Loop
 using channel:entries as an example
            limit = 100
The Cost of a Loop
 using channel:entries as an example
            limit = 500
The Cost of a Loop
 using channel:entries as an example
            limit = 1000
The Cost of a Loop
 using channel:entries as an example
            limit = 2500
The Cost of a Loop
  the effect on the database queries
The Cost of a Loop
          the effect on the database queries




  24

 100
entries
The Cost of a Loop
          the effect on the database queries




  24              24

 100            500
entries        entries
The Cost of a Loop
          the effect on the database queries




  24              24            24

 100            500            1000
entries        entries        entries
The Cost of a Loop
          the effect on the database queries




  24              24            24               24

 100            500            1000             2500
entries        entries        entries          entries
The Cost of a Loop
  the effect on the database queries




      with current db_cache
The Cost of a Loop
  the effect on the database queries




                6-8

                for n
               entries
      with current db_cache
Increasing Complexity
Increasing Complexity
Lather, Repeat, Rinse
using an “optimised” channel:entries as an example
        {exp:channel:entries
           dynamic=“no”
           channel=“example”
           limit=“1”
           disable=“{disable_entries}
           ”
           cache=“yes”
           refresh=“900”}
Lather, Repeat, Rinse
     with everything disabled
Lather, Repeat, Rinse
     with everything disabled



               21


         for n entries
Lather, Repeat, Rinse
      with tag caching on




         uncached
Lather, Repeat, Rinse
      with tag caching on




      caches primed
What we want:
What we want:
•
Caches shouldn’t be relied on to get good
performance
What we want:
•
Caches shouldn’t be relied on to get good
performance

•
Entry count shouldn’t affect the number of
Database queries
What we want:
•Caches shouldn’t be relied on to get good
 performance

•Entry count shouldn’t affect the number of
 Database queries

•Entry count should relate linearly to template
 processing time
What we want:
•Caches shouldn’t be relied on to get good
 performance

•Entry count shouldn’t affect the number of
 Database queries

•Entry count should relate linearly to template
 processing time

•What works for 10, needs to scale to work for
 10,000
Nested Loops
Nested Loops

“   Pro tip: don't ever, ever nest a
    channel:entries tag inside another
    tag that loops. Srsly. Don't.
    #eecms
                               @low
Nested Loops

“   Pro tip: don't ever, ever nest a
    channel:entries tag inside another
    tag that loops. Srsly. Don't.
    #eecms
                               @low
Nested Loops
 Category Archive Page
Nested Loops
            Category Archive Page




Category Loop {
Nested Loops
            Category Archive Page


                              } Entries Loop

Category Loop {               } Entries Loop

                              } Entries Loop
Nested Loops
 Category Archive Page
Nested Loops
            Category Archive Page



What you’d expect :
Nested Loops
            Category Archive Page



What you’d expect :   +2   for category loop
Nested Loops
            Category Archive Page



What you’d expect :   +2   for category loop


                      +3   for entries loop
Nested Loops
          Category Archive Page



What you get :
Nested Loops
          Category Archive Page



What you get :     +2   for category loop
Nested Loops
          Category Archive Page



What you get :     +2   for category loop


                   +3
Nested Loops
          Category Archive Page



What you get :     +2   for category loop

                        for EACH entries loop
                   +3
                            PER CATEGORY
Nested Loops
            Category Archive Page



With some tuning
 (and some php)

  you can get:
Nested Loops
            Category Archive Page



With some tuning     +2   for category loop
 (and some php)

  you can get:
Nested Loops
            Category Archive Page



With some tuning     +2   for category loop
 (and some php)

  you can get:       +3   for entries loop
Nested Loops
            Category Archive Page



With some tuning      +2   for category loop
 (and some php)

  you can get:        +3   for entries loop

           see : bit.ly/eeci2010_low
Where the pain comes
        from
Where the pain comes
        from

 Never testing with end-scale datasets
Key Points
Key Points
Key Points
•Don’t rely on caches
 for performance
Key Points
•Don’t rely on caches
 for performance

•Measure as you go
Key Points
•Don’t rely on caches   •Test with end-scale
 for performance         data sets

•Measure as you go
Key Points
•Don’t rely on caches   •Test with end-scale
 for performance         data sets

•Measure as you go      •Understand what’s
                         going on
Thank you

Tuning your Engine
  @joelbradbury
  @viewcreative

More Related Content

PPTX
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
PDF
Walkthrough Neo4j 1.9 & 2.0
PPTX
DAT402 - Deep Dive on Amazon Aurora PostgreSQL
PDF
Connect2016 AD1387 Integrate with XPages and Java
PPTX
Database Test Cases or Why We Chose Neo4j?
PDF
Speedment - Reactive programming for Java8
PDF
Apache Spark v3.0.0
PDF
CMU TREC 2007 Blog Track
Amazon RDS for PostgreSQL - Postgres Open 2016 - New Features and Lessons Lea...
Walkthrough Neo4j 1.9 & 2.0
DAT402 - Deep Dive on Amazon Aurora PostgreSQL
Connect2016 AD1387 Integrate with XPages and Java
Database Test Cases or Why We Chose Neo4j?
Speedment - Reactive programming for Java8
Apache Spark v3.0.0
CMU TREC 2007 Blog Track

What's hot (18)

PPTX
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
PPTX
Pg conf 2017 HIPAA Compliant and HA DB architecture on AWS
PDF
Lessons learned while building Omroep.nl
PPTX
Deep dive into the Rds PostgreSQL Universe Austin 2017
PPTX
Spark vs storm
PDF
Tuning Solr and its Pipeline for Logs: Presented by Rafał Kuć & Radu Gheorghe...
PDF
Lessons learned while building Omroep.nl
PDF
Amazon (AWS) Aurora
PDF
Search-time Parallelism: Presented by Shikhar Bhushan, Etsy
PPTX
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
PDF
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
PDF
Top 5 mistakes when writing Spark applications
PDF
First oslo solr community meetup lightning talk janhoy
PDF
Compiled Websites with Plone, Django, Xapian and SSI
PPTX
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
KEY
ElephantDB
PPTX
Big data elasticsearch practical
PDF
Scaling search with Solr Cloud
Amazon RDS for PostgreSQL: What's New and Lessons Learned - NY 2017
Pg conf 2017 HIPAA Compliant and HA DB architecture on AWS
Lessons learned while building Omroep.nl
Deep dive into the Rds PostgreSQL Universe Austin 2017
Spark vs storm
Tuning Solr and its Pipeline for Logs: Presented by Rafał Kuć & Radu Gheorghe...
Lessons learned while building Omroep.nl
Amazon (AWS) Aurora
Search-time Parallelism: Presented by Shikhar Bhushan, Etsy
Tuning Apache Ambari Performance for Big Data at Scale with 3,000 Agents
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
Top 5 mistakes when writing Spark applications
First oslo solr community meetup lightning talk janhoy
Compiled Websites with Plone, Django, Xapian and SSI
re:Invent 2020 DAT301 Deep Dive on Amazon Aurora with PostgreSQL Compatibility
ElephantDB
Big data elasticsearch practical
Scaling search with Solr Cloud
Ad

Viewers also liked (20)

PPTX
Trouble shooting in gear box
PPTX
Clutches & brakes
PPTX
Operation of centrifugal clutch
PPTX
Types of Maintenance
PPTX
Regenerative braking system
PPSX
Coupling clutch brake
PPTX
Regenerative braking system
PPTX
Clutch(single and multi plate)
PPTX
Clutches - Working and Application
PPT
Regenerative braking system
PPT
Laminar Flow
PPTX
Air filter seminar ppt
PPT
Clutches
PPTX
Regenerative braking system
PPTX
Embedded Systems in Automobile
PPTX
ppt on embedded system
PDF
Maintenance types
PDF
Embedded Systems in Automotive
PPT
Hepa filters PPT
PDF
Clutches for automobile
Trouble shooting in gear box
Clutches & brakes
Operation of centrifugal clutch
Types of Maintenance
Regenerative braking system
Coupling clutch brake
Regenerative braking system
Clutch(single and multi plate)
Clutches - Working and Application
Regenerative braking system
Laminar Flow
Air filter seminar ppt
Clutches
Regenerative braking system
Embedded Systems in Automobile
ppt on embedded system
Maintenance types
Embedded Systems in Automotive
Hepa filters PPT
Clutches for automobile
Ad

Similar to Tuning Your Engine (20)

PDF
Your backend architecture is what matters slideshare
PDF
Scalable, good, cheap
PDF
Class 7: Introduction to web technology entrepreneurship
PDF
CMF: a pain in the F @ PHPDay 05-14-2011
PDF
Sensible scaling
PDF
Best practices-wordpress-enterprise
PDF
Top ten-list
PPT
Top 10 Scalability Mistakes
PDF
PyGrunn2013 High Performance Web Applications with TurboGears
PPTX
BTV PHP - Building Fast Websites
PPTX
Best Practices for WordPress in Enterprise
PPT
Apache Con 2008 Top 10 Mistakes
PPT
scale_perf_best_practices
PPTX
Northeast PHP - High Performance PHP
PDF
Flexible web publishing with Expression Engine
PDF
The Open Commerce Conference - Premature Optimisation: The Root of All Evil
PDF
The PHP Anthology
PDF
Scalable talk notes
PDF
Rails Hosting and the Woes
PDF
Five steps perform_2013
Your backend architecture is what matters slideshare
Scalable, good, cheap
Class 7: Introduction to web technology entrepreneurship
CMF: a pain in the F @ PHPDay 05-14-2011
Sensible scaling
Best practices-wordpress-enterprise
Top ten-list
Top 10 Scalability Mistakes
PyGrunn2013 High Performance Web Applications with TurboGears
BTV PHP - Building Fast Websites
Best Practices for WordPress in Enterprise
Apache Con 2008 Top 10 Mistakes
scale_perf_best_practices
Northeast PHP - High Performance PHP
Flexible web publishing with Expression Engine
The Open Commerce Conference - Premature Optimisation: The Root of All Evil
The PHP Anthology
Scalable talk notes
Rails Hosting and the Woes
Five steps perform_2013

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Reach Out and Touch Someone: Haptics and Empathic Computing
MIND Revenue Release Quarter 2 2025 Press Release
MYSQL Presentation for SQL database connectivity

Tuning Your Engine

Editor's Notes

  • #22: All things to all men Implement the 30% features you need, you could do it quicker
  • #24: - Micheal Boiynk addon has the right idea
  • #25: - Micheal Boiynk addon has the right idea
  • #26: - Micheal Boiynk addon has the right idea
  • #27: - Micheal Boiynk addon has the right idea
  • #43: From the Agile records home page
  • #44: From the Agile records home page
  • #45: From the Agile records home page
  • #90: Embeds, loops, conditionals etc... (time)
  • #118: Need to do this as you go
  • #157: A wise old man told me I should end with key points