SlideShare a Scribd company logo
1 of 69
Download to read offline
6 /08/2 009       ting
2
           elux mee
PHP   Ben
      Welkom!
r form ance
Websi te Pe
                                    es
                      end te chniqu
                     t
             nd fron
     Back- a
Who am I?
Who are you?
What is this talk about?




Disclaimer: I’m no expert and still learning every day, most of my
        knowledge is theoretically so please correct me!
Pukkelpop.be
Serverside & Clientside
     Both deserve attention
rverside
                      Se
                                       …
                              C oding,
                 e, Ca ching,
                s
   ling, Databa
Sca
ts
                                       icates i rk in a
Sc aling        of
        opertyandle grow
                          m
                   a syste ing amo
                                   ind
                             which unts of wo
    A pr to h
    ability ul manner
    gracef
Scaling
   Vertically   Horizontally
Scaling Vertically
             Add more resources to a single computer
Scaling Horizontally
             Add more nodes to a distributed system
Scaling, the Google way
"Nobody builds servers as unreliably as we do"
Urs Hölzle, senior vice president for operations at Google
cd.com
                           www.xk




       e
    bas mization, Query optimization,
Data se opti
      Databa
             s
      Indexe
Database optimization
Query optimization
Indexes
A couple of tips




More at http://forge.mysql.com/wiki/Top10SQLPerformanceTips
Scaling databases
     Master / Slave setup                      Sharding

           Master (write)                         Master




Slave (read)           Slave (read)   Even userId’s    Uneven userId’s
Scaling databases
 Master / Slave setup   Sharding
Master / Slave setup
Sharding code example
cd.com
                                   www.xk




   hing
                                             al
                                    g origin earlier,
Cac
                                 in
                        d uplicatcomputed
          ction of data here or        sive to fet
                                                   ch
   A colle stored elsew ata is expen
   values the original d
   where
Basics of caching
                         DATA REQUEST




          YES                                    NO
                         CACHED AND
                           FRESH?




      FETCH FROM CACHE                  FETCH FROM DATABASE




                                           SAVE IN CACHE




                         RETURN DATA
Basics of caching: example
Three methods of caching
  TTL     Invalidation   Updating
Caching: TTL
Caching: Invalidation
Caching: Updating
Caching types
Intermediate Cache
                webserver   cache server




                             Internet
Caching software, …
Memcached
Memcached: what?
Memcached: Who?
Memcached: Some figures
       Netlog                             Wikipedia                             Facebook




http://www.slideshare.net/folke/netlog-what-we-learned-about-scalability-high-availability-430211
http://meta.wikimedia.org/wiki/Wikimedia_servers#Server_list
http://www.facebook.com/note.php?note_id=39391378919
C lient side
                                                ,…
                                          ineers
                             ronte nd eng
                     r   f
           t ices fo
Be st prac
Why optimize clientside?


Source: http://www.websiteoptimization.com/speed/tweak/average-web-page/
The 80/20 Rule
0.295s
Parallel downloads
Parallel downloads
Best Practices
1. Make fewer HTTP requests
1. Make fewer HTTP requests

   CSS Sprites




                 #nav li a {background-image:url('../img/image_nav.gif')}
                 #nav li a.item1 {background-position:0px -140px}
1. Make fewer HTTP requests

   Inline images
1. Make fewer HTTP requests

  Combine CSS/JS
2. Use a CDN
3. Gzip components
3. Gzip components
4. Move CSS to the top
4. Move JS to the bottom
5. Minify JS and CSS
6. Make dynamic images cacheable
6. Make dynamic images cacheable

     ETags         Expires Headers
6. Make dynamic images cacheable
                First send the cache related headers
6. Make dynamic images cacheable
            Then generate an Etag and check the request
6. Make dynamic images cacheable
              Check the modified since request header
6. Make dynamic images cacheable
           And finally output the image if no cache match
6. Make dynamic images cacheable
7. Optimize images
7. Anticipate updates
Tools           ls for o
                         pt imizatio
                                    n

    Usefull too
Standalone
Firefox plugins
Website Performance: server- and clientside techniques
Website Performance: server- and clientside techniques

More Related Content

What's hot

Memory Management Made Simple: Kevin Mcghee, Madelyn Olson
Memory Management Made Simple: Kevin Mcghee, Madelyn OlsonMemory Management Made Simple: Kevin Mcghee, Madelyn Olson
Memory Management Made Simple: Kevin Mcghee, Madelyn Olson
Redis Labs
 

What's hot (9)

Caching basics in PHP
Caching basics in PHPCaching basics in PHP
Caching basics in PHP
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
Scaling Rails with Memcached
Scaling Rails with MemcachedScaling Rails with Memcached
Scaling Rails with Memcached
 
Memory Management Made Simple: Kevin Mcghee, Madelyn Olson
Memory Management Made Simple: Kevin Mcghee, Madelyn OlsonMemory Management Made Simple: Kevin Mcghee, Madelyn Olson
Memory Management Made Simple: Kevin Mcghee, Madelyn Olson
 
Introduction to Big Data and Hadoop
Introduction to Big Data and HadoopIntroduction to Big Data and Hadoop
Introduction to Big Data and Hadoop
 
Interview questions on Apache spark [part 2]
Interview questions on Apache spark [part 2]Interview questions on Apache spark [part 2]
Interview questions on Apache spark [part 2]
 
Florida State University Open Stack
Florida State University Open StackFlorida State University Open Stack
Florida State University Open Stack
 
A day in the life of hadoop administrator!
A day in the life of hadoop administrator!A day in the life of hadoop administrator!
A day in the life of hadoop administrator!
 

Similar to Website Performance: server- and clientside techniques

Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
guest18a0f1
 
Scalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & ApproachesScalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & Approaches
Cal Henderson
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
Joseph Scott
 
Growing Up MongoDB
Growing Up MongoDBGrowing Up MongoDB
Growing Up MongoDB
MongoDB
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCScalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Cal Henderson
 

Similar to Website Performance: server- and clientside techniques (20)

Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESSpring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
Web20expo Scalable Web Arch
Web20expo Scalable Web ArchWeb20expo Scalable Web Arch
Web20expo Scalable Web Arch
 
2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire
 
Rails Asset Pipeline - What, Why, Tips, Do's and Dont's
Rails Asset Pipeline - What, Why, Tips, Do's and Dont'sRails Asset Pipeline - What, Why, Tips, Do's and Dont's
Rails Asset Pipeline - What, Why, Tips, Do's and Dont's
 
Scalable Web Arch
Scalable Web ArchScalable Web Arch
Scalable Web Arch
 
Scalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & ApproachesScalable Web Architectures - Common Patterns & Approaches
Scalable Web Architectures - Common Patterns & Approaches
 
Apache Traffic Server
Apache Traffic ServerApache Traffic Server
Apache Traffic Server
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Growing Up MongoDB
Growing Up MongoDBGrowing Up MongoDB
Growing Up MongoDB
 
JS digest. July 2018
JS digest.  July 2018JS digest.  July 2018
JS digest. July 2018
 
Data Streaming Technology Overview
Data Streaming Technology OverviewData Streaming Technology Overview
Data Streaming Technology Overview
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
 
HTTP cache @ PUG Rome 03-29-2011
HTTP cache @ PUG Rome 03-29-2011HTTP cache @ PUG Rome 03-29-2011
HTTP cache @ PUG Rome 03-29-2011
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYCScalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
 
JS in Rural Communities
JS in Rural CommunitiesJS in Rural Communities
JS in Rural Communities
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 
The Server Side of Responsive Web Design
The Server Side of Responsive Web DesignThe Server Side of Responsive Web Design
The Server Side of Responsive Web Design
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajax
 

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
Muhammad Subhan
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 

Website Performance: server- and clientside techniques