SlideShare a Scribd company logo
Angus Li(@angusli)
 Performance paradigm
 Basic rules of website performance
 Optimize LAMP stack
 Tweak Magento box
 Tools & utilities
 Donald Knuth says “Premature optimization       is the
 root of all evil”
    ... so choose the right time to start your optimization

 Performance optimization is an ever going task
      … so don’t think your optimization is “once for all”,
         keep identifying the bottleneck of your site and
                        make improvement little by little
Server side         Network/HTTP                  Browser

Process your page      Transfer your           Render your page
  as quickly as      content as quickly          as quickly as
    possible            as possible                possible

                    Performance optimization
   #1: Make Fewer HTTP Requests
   #2: Use a Content Delivery Network
   #3: Add an Expires Header
   #4: Gzip Components
   #5: Put Stylesheets at the Top
   #6: Put Scripts at the Bottom
   #7: Avoid CSS Expressions
   #8: Make JavaScript and CSS External
   #9: Reduce DNS Lookups
   #10: Minify JavaScript
   #11: Avoid Redirects
   #12: Remove Duplicate Scripts
   #13: Configure Etags
   #14: Make AJAX Cacheable
                               ---- High Performance Web Sites by Steve Souders
 Install a minimal Linux distribution with necessary
  packages only, get rid of GUI, X-window etc.
 Stop and disable the unused services, e.g. cups
 Tweak kernel parameters:
  #   echo '8192' > /proc/sys/fs/file-max
  #   echo '32768' > /proc/sys/fs/inode-max
  #   echo 268435456 >/proc/sys/kernel/shmall
  #   echo 268435456 >/proc/sys/kernel/shmmax
  #   ulimit -n 4096
 Compile required modules statically instead of
 DSO(Dynamic Shared Object), and disabled useless
 modules

  ./configure --prefix=/usr/local/apache2 --disable-
    status --disable-userdir --disable-threads --disable-
    ipv6 --enable-modules='ssl so rewrite deflate headers
    expires'

  Why? http://httpd.apache.org/docs/2.2/dso.html#advantages
  “DSO has the following disadvantages”
 Open .htaccess under Magento root directory,
 uncomment the directives between “<IfModule
 mod_deflate.c>” and “</IfModule>

  <IfModule mod_deflate.c>
      AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4.0[678] no-gzip
      BrowserMatch bMSIE !no-gzip !gzip-only-text/html
      SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
      Header append Vary User-Agent env=!dont-vary
  </IfModule>
 Open .htaccess and use following lines to replace the
 section between “<IfModule mod_expires.c>” and
 “</IfModule>”

  <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 1 month"
      ExpiresByType image/x-icon "access plus 1 month"
      ExpiresByType text/html "access plus 1 month"
      ExpiresByType text/plain "access plus 1 month"
      ExpiresByType text/css "access plus 1 month"
      ExpiresByType application/x-javascript "access plus 1 month"
      ExpiresByType application/x-shockwave-flash "access plus 1 month"
  </IfModule>
 Open .httaccess and scroll to the end, uncomment the
 directive “FileETag none”, also add several lines more if
 you haven’t enabled KeepAlive in httpd.conf

  FileETag None
  KeepAlive On
  MaxKeepAliveRequests 200
  KeepAliveTimeout 5
 Open your my.cnf and update the following
 parameters:

  skip-name-resolve
  innodb_buffer_pool_size=768M
  innodb_flush_log_at_trx_commit=2

 As time goes by, use Tuning Primer to check your
 MySQL status and adjust configuration accordingly
 Similar as compiling Apache, compile required
 extensions statically and disable unused modules

  ./configure --prefix=/usr/local/php --with-
    apxs2=/usr/local/apache2/bin/apxs --with-config-file-
    path=/etc/php --with-png-dir --with-jpeg-dir --with-
    gd --with-curl --with-zlib --enable-mbstring --with-
    mcrypt --with-freetype-dir=/usr --with-
    mysql=/usr/bin/mysql --with-mysqli --enable-pdo --
    with-pdo-mysql=/usr/bin/mysql --without-pdo-sqlite --
    with-openssl
 Download latest stable version from eaccelerator.net
 Compile by enabling Shared Memory(for Magento
 cache, will talk about this later)

  ./configure --with-eaccelerator-shared-memory
    --enable-eaccelerator=shared --with-php-
    config=/usr/local/php/bin/php-config
 Add an Expires Header
 Gzip Components
 Configure Etags
 A lightweight LAMP stack which can boost your
  website performance maximally
 A fast-enough environment to run Magento efficiently




        Let’s move to Magento box!
 Cache with multiple adaptors
 Compiler
 Combine CSS & JS files
 Parallel Downloads
 Go to Magento Admin Panel  System  Cache
 Management

   All Cache  Enable
   Layered Navigation  Yes


 Admin Panel  System  Configuration  Catalog
  Frontend

   Use Flat Catalog Category  Yes
   Use Flat Catalog Product  Yes
 Open {Magento_root}/app/etc/local.xml, add the
 following three lines

  ...
      </resources>
      <session_save><![CDATA[files]]></session_save>
      <cache>
          <backend>eaccelerator</backend>
      </cache>
  </global>
  ...
 Admin Panel  System  Tools  Compilation 
 Run Compilation Process
 Admin Panel  System  Configuration  Developer


   Javascript Settings  Merge Javascript Files  Yes
   CSS Settings  Merge CSS Files  Yes
 Set up the following separate domains and point the
 VirtualHost DocumentRoot to corresponding paths
 under Magento folder

   js.foo.com  {Magento_root}/js
   media.foo.com  {Magento_root}/media
   skin.foo.com  {Magento_root}/skin


 Then go to Admin Panel  System  Configuration
  Website  Unsecure, and configure the Basic URLs
 accordingly
 Make Fewer HTTP Requests
 Put Stylesheets at the Top
 Make JavaScript and CSS External
 Reduce DNS Lookups
 Minify JavaScript
   Make Fewer HTTP Requests
     Add an Expires Header
     Gzip Components
     Put Stylesheets at the Top
     Avoid CSS Expressions (applies by default)
     Make JavaScript and CSS External
     Reduce DNS Lookups
     Minify JavaScript
     Avoid Redirects (applies by default)
     Remove Duplicate Scripts (applies by default)
     Configure Etags
     Make AJAX Cacheable (applies by default)

 You’ve made 12/14! That’s GREAT enough for a site at
 the beginning, agree?
 Firebug http://getfirebug.com/
 YSlow http://developer.yahoo.com/yslow/
 Page Speed http://code.google.com/speed/page-speed/docs/using.html
 Tuning Primer http://forge.mysql.com/projects/project.php?id=44
 WebPagetest http://www.webpagetest.org/
For more practices, go to Magento performance and optimization group

More Related Content

What's hot

Magento caching
Magento cachingMagento caching
Magento caching
Yireo
 
Magento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side OptimizationsMagento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side Optimizations
PINT Inc
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
SiteGround.com
 
Magento performance
Magento performanceMagento performance
Magento performance
Divante
 
Magento security best practices 2015
Magento security best practices 2015Magento security best practices 2015
Magento security best practices 2015
Philippe Humeau
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012
eballisty
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
Mathew Beane
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)WordCamp Cape Town
 
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupMagento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Kelly Mason
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
Thanh Chau
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedAcquia
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + MemcachedFord AntiTrust
 
How to reduce database load using Memcache
How to reduce database load using MemcacheHow to reduce database load using Memcache
How to reduce database load using Memcache
valuebound
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
Wim Godden
 
Improving PHP Application Performance with APC
Improving PHP Application Performance with APCImproving PHP Application Performance with APC
Improving PHP Application Performance with APC
vortexau
 
Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2
Max Pronko
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
Ben Ramsey
 
Dutch php conference_2010_opm
Dutch php conference_2010_opmDutch php conference_2010_opm
Dutch php conference_2010_opmisnull
 

What's hot (20)

Magento caching
Magento cachingMagento caching
Magento caching
 
Magento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side OptimizationsMagento Performance Improvements with Client Side Optimizations
Magento Performance Improvements with Client Side Optimizations
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
Magento performance
Magento performanceMagento performance
Magento performance
 
Magento security best practices 2015
Magento security best practices 2015Magento security best practices 2015
Magento security best practices 2015
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)
 
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupMagento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
 
04 web optimization
04 web optimization04 web optimization
04 web optimization
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 
Servlets
ServletsServlets
Servlets
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
 
How to reduce database load using Memcache
How to reduce database load using MemcacheHow to reduce database load using Memcache
How to reduce database load using Memcache
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
 
Improving PHP Application Performance with APC
Improving PHP Application Performance with APCImproving PHP Application Performance with APC
Improving PHP Application Performance with APC
 
Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
Dutch php conference_2010_opm
Dutch php conference_2010_opmDutch php conference_2010_opm
Dutch php conference_2010_opm
 

Viewers also liked

Magento 2 Code Generation Tools
Magento 2 Code Generation ToolsMagento 2 Code Generation Tools
Magento 2 Code Generation Tools
Óscar Recio Soria
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
Max Pronko
 
How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2
Magestore
 
Max Pronko - Best practices for checkout customisation in Magento 2
Max Pronko - Best practices for checkout customisation in Magento 2Max Pronko - Best practices for checkout customisation in Magento 2
Max Pronko - Best practices for checkout customisation in Magento 2
Meet Magento Italy
 
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Joshua Warren
 
How To Create Theme in Magento 2 - Part 1
How To Create Theme in Magento 2 - Part 1How To Create Theme in Magento 2 - Part 1
How To Create Theme in Magento 2 - Part 1
Magestore
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
Mathew Beane
 
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...varien
 
Magento Performance Toolkit
Magento Performance ToolkitMagento Performance Toolkit
Magento Performance Toolkit
Sergii Shymko
 
Intro to HTML (Kid's Class at TIY)
Intro to HTML (Kid's Class at TIY)Intro to HTML (Kid's Class at TIY)
Intro to HTML (Kid's Class at TIY)
Marjorie Sample
 
Basic Html Tags Tutorial For Kids
Basic Html Tags Tutorial For KidsBasic Html Tags Tutorial For Kids
Basic Html Tags Tutorial For Kids
Olivia Moran
 
Magento 2 - hands on MeetMagento Romania 2016
Magento 2 -  hands on MeetMagento Romania 2016Magento 2 -  hands on MeetMagento Romania 2016
Magento 2 - hands on MeetMagento Romania 2016
Andra Elena Lungu
 
Dlaczego rozwiązania open source dla e-commerce?
Dlaczego rozwiązania open source dla e-commerce?Dlaczego rozwiązania open source dla e-commerce?
Dlaczego rozwiązania open source dla e-commerce?
Bold Brand Commerce
 
Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Ivan Chepurnyi
 
Magento 2 Development Best Practices
Magento 2 Development Best PracticesMagento 2 Development Best Practices
Magento 2 Development Best Practices
Ben Marks
 
Javascript #1 - StartIt centar Indjija
Javascript #1 - StartIt centar IndjijaJavascript #1 - StartIt centar Indjija
Javascript #1 - StartIt centar Indjija
Dušan Stanković
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.
Web Visitors
 
6. Uvod u informatiku - Hardver i softver računara
6. Uvod u informatiku - Hardver i softver računara6. Uvod u informatiku - Hardver i softver računara
6. Uvod u informatiku - Hardver i softver računara
Zoran Ilić
 

Viewers also liked (20)

Magento 2 Code Generation Tools
Magento 2 Code Generation ToolsMagento 2 Code Generation Tools
Magento 2 Code Generation Tools
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
 
How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2How to create theme in Magento 2 - Part 2
How to create theme in Magento 2 - Part 2
 
Max Pronko - Best practices for checkout customisation in Magento 2
Max Pronko - Best practices for checkout customisation in Magento 2Max Pronko - Best practices for checkout customisation in Magento 2
Max Pronko - Best practices for checkout customisation in Magento 2
 
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
 
How To Create Theme in Magento 2 - Part 1
How To Create Theme in Magento 2 - Part 1How To Create Theme in Magento 2 - Part 1
How To Create Theme in Magento 2 - Part 1
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
Magento e commerce performance optimization
Magento e commerce performance optimizationMagento e commerce performance optimization
Magento e commerce performance optimization
 
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
Magento Imagine eCommerce Conference:5 Way to Supercharge your Magento Enterp...
 
Magento Performance Toolkit
Magento Performance ToolkitMagento Performance Toolkit
Magento Performance Toolkit
 
Intro to HTML (Kid's Class at TIY)
Intro to HTML (Kid's Class at TIY)Intro to HTML (Kid's Class at TIY)
Intro to HTML (Kid's Class at TIY)
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
Basic Html Tags Tutorial For Kids
Basic Html Tags Tutorial For KidsBasic Html Tags Tutorial For Kids
Basic Html Tags Tutorial For Kids
 
Magento 2 - hands on MeetMagento Romania 2016
Magento 2 -  hands on MeetMagento Romania 2016Magento 2 -  hands on MeetMagento Romania 2016
Magento 2 - hands on MeetMagento Romania 2016
 
Dlaczego rozwiązania open source dla e-commerce?
Dlaczego rozwiązania open source dla e-commerce?Dlaczego rozwiązania open source dla e-commerce?
Dlaczego rozwiązania open source dla e-commerce?
 
Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)
 
Magento 2 Development Best Practices
Magento 2 Development Best PracticesMagento 2 Development Best Practices
Magento 2 Development Best Practices
 
Javascript #1 - StartIt centar Indjija
Javascript #1 - StartIt centar IndjijaJavascript #1 - StartIt centar Indjija
Javascript #1 - StartIt centar Indjija
 
How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.How to Install Magento 2 on XAMPP Server localhost.
How to Install Magento 2 on XAMPP Server localhost.
 
6. Uvod u informatiku - Hardver i softver računara
6. Uvod u informatiku - Hardver i softver računara6. Uvod u informatiku - Hardver i softver računara
6. Uvod u informatiku - Hardver i softver računara
 

Similar to Magento Performance Optimization 101

Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
Sam Keen
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
Twinbit
 
Drupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp NorthDrupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp North
Philip Norton
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
Walter Ebert
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityAshok Modi
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and Scalability
Mediacurrent
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
Greg Whalin
 
Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
Wim Godden
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
Ashok Modi
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
Stevie T
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
Ashok Modi
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
sacred 8
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
Matteo Moretti
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
Wim Godden
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.
Arshak Movsisyan
 
Apache Traffic Server
Apache Traffic ServerApache Traffic Server
Apache Traffic Server
supertom
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
Sarvesh Kushwaha
 
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
I-Verve Inc
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
Nilesh Bafna
 

Similar to Magento Performance Optimization 101 (20)

Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Drupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp NorthDrupal Performance : DrupalCamp North
Drupal Performance : DrupalCamp North
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Drupal Frontend Performance and Scalability
Drupal Frontend Performance and ScalabilityDrupal Frontend Performance and Scalability
Drupal Frontend Performance and Scalability
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and Scalability
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
 
DrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizingDrupalCampLA 2011 - Drupal frontend-optimizing
DrupalCampLA 2011 - Drupal frontend-optimizing
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
Building high performance web apps.
Building high performance web apps.Building high performance web apps.
Building high performance web apps.
 
Apache Traffic Server
Apache Traffic ServerApache Traffic Server
Apache Traffic Server
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
 
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Magento Performance Optimization 101

  • 2.  Performance paradigm  Basic rules of website performance  Optimize LAMP stack  Tweak Magento box  Tools & utilities
  • 3.  Donald Knuth says “Premature optimization is the root of all evil” ... so choose the right time to start your optimization  Performance optimization is an ever going task … so don’t think your optimization is “once for all”, keep identifying the bottleneck of your site and make improvement little by little
  • 4.
  • 5. Server side Network/HTTP Browser Process your page Transfer your Render your page as quickly as content as quickly as quickly as possible as possible possible Performance optimization
  • 6. #1: Make Fewer HTTP Requests  #2: Use a Content Delivery Network  #3: Add an Expires Header  #4: Gzip Components  #5: Put Stylesheets at the Top  #6: Put Scripts at the Bottom  #7: Avoid CSS Expressions  #8: Make JavaScript and CSS External  #9: Reduce DNS Lookups  #10: Minify JavaScript  #11: Avoid Redirects  #12: Remove Duplicate Scripts  #13: Configure Etags  #14: Make AJAX Cacheable ---- High Performance Web Sites by Steve Souders
  • 7.
  • 8.  Install a minimal Linux distribution with necessary packages only, get rid of GUI, X-window etc.  Stop and disable the unused services, e.g. cups  Tweak kernel parameters: # echo '8192' > /proc/sys/fs/file-max # echo '32768' > /proc/sys/fs/inode-max # echo 268435456 >/proc/sys/kernel/shmall # echo 268435456 >/proc/sys/kernel/shmmax # ulimit -n 4096
  • 9.  Compile required modules statically instead of DSO(Dynamic Shared Object), and disabled useless modules ./configure --prefix=/usr/local/apache2 --disable- status --disable-userdir --disable-threads --disable- ipv6 --enable-modules='ssl so rewrite deflate headers expires' Why? http://httpd.apache.org/docs/2.2/dso.html#advantages “DSO has the following disadvantages”
  • 10.  Open .htaccess under Magento root directory, uncomment the directives between “<IfModule mod_deflate.c>” and “</IfModule> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch bMSIE !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary Header append Vary User-Agent env=!dont-vary </IfModule>
  • 11.  Open .htaccess and use following lines to replace the section between “<IfModule mod_expires.c>” and “</IfModule>” <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 month" ExpiresByType image/x-icon "access plus 1 month" ExpiresByType text/html "access plus 1 month" ExpiresByType text/plain "access plus 1 month" ExpiresByType text/css "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" </IfModule>
  • 12.  Open .httaccess and scroll to the end, uncomment the directive “FileETag none”, also add several lines more if you haven’t enabled KeepAlive in httpd.conf FileETag None KeepAlive On MaxKeepAliveRequests 200 KeepAliveTimeout 5
  • 13.  Open your my.cnf and update the following parameters: skip-name-resolve innodb_buffer_pool_size=768M innodb_flush_log_at_trx_commit=2  As time goes by, use Tuning Primer to check your MySQL status and adjust configuration accordingly
  • 14.  Similar as compiling Apache, compile required extensions statically and disable unused modules ./configure --prefix=/usr/local/php --with- apxs2=/usr/local/apache2/bin/apxs --with-config-file- path=/etc/php --with-png-dir --with-jpeg-dir --with- gd --with-curl --with-zlib --enable-mbstring --with- mcrypt --with-freetype-dir=/usr --with- mysql=/usr/bin/mysql --with-mysqli --enable-pdo -- with-pdo-mysql=/usr/bin/mysql --without-pdo-sqlite -- with-openssl
  • 15.  Download latest stable version from eaccelerator.net  Compile by enabling Shared Memory(for Magento cache, will talk about this later) ./configure --with-eaccelerator-shared-memory --enable-eaccelerator=shared --with-php- config=/usr/local/php/bin/php-config
  • 16.  Add an Expires Header  Gzip Components  Configure Etags
  • 17.  A lightweight LAMP stack which can boost your website performance maximally  A fast-enough environment to run Magento efficiently Let’s move to Magento box!
  • 18.
  • 19.  Cache with multiple adaptors  Compiler  Combine CSS & JS files  Parallel Downloads
  • 20.  Go to Magento Admin Panel  System  Cache Management  All Cache  Enable  Layered Navigation  Yes  Admin Panel  System  Configuration  Catalog  Frontend  Use Flat Catalog Category  Yes  Use Flat Catalog Product  Yes
  • 21.  Open {Magento_root}/app/etc/local.xml, add the following three lines ... </resources> <session_save><![CDATA[files]]></session_save> <cache> <backend>eaccelerator</backend> </cache> </global> ...
  • 22.  Admin Panel  System  Tools  Compilation  Run Compilation Process
  • 23.  Admin Panel  System  Configuration  Developer  Javascript Settings  Merge Javascript Files  Yes  CSS Settings  Merge CSS Files  Yes
  • 24.  Set up the following separate domains and point the VirtualHost DocumentRoot to corresponding paths under Magento folder  js.foo.com  {Magento_root}/js  media.foo.com  {Magento_root}/media  skin.foo.com  {Magento_root}/skin  Then go to Admin Panel  System  Configuration  Website  Unsecure, and configure the Basic URLs accordingly
  • 25.  Make Fewer HTTP Requests  Put Stylesheets at the Top  Make JavaScript and CSS External  Reduce DNS Lookups  Minify JavaScript
  • 26. Make Fewer HTTP Requests  Add an Expires Header  Gzip Components  Put Stylesheets at the Top  Avoid CSS Expressions (applies by default)  Make JavaScript and CSS External  Reduce DNS Lookups  Minify JavaScript  Avoid Redirects (applies by default)  Remove Duplicate Scripts (applies by default)  Configure Etags  Make AJAX Cacheable (applies by default)  You’ve made 12/14! That’s GREAT enough for a site at the beginning, agree?
  • 27.  Firebug http://getfirebug.com/  YSlow http://developer.yahoo.com/yslow/  Page Speed http://code.google.com/speed/page-speed/docs/using.html  Tuning Primer http://forge.mysql.com/projects/project.php?id=44  WebPagetest http://www.webpagetest.org/
  • 28. For more practices, go to Magento performance and optimization group