Magento eCommerce Performance OptimizationAshish PurohitRanosys Technologies Pte Ltd30 Apr 2013
What we will discuss today? What is Magento? Comparison with other eCommerce platform What people think about Magento?...
What is Magento? Open source rich eCommerce platform developed on PHP Zendframework First stable release in 2008 by Vari...
Comparison with other platform
Comparison with other platform Magento is leader in this domain.
What people think about Magento? User experience is leggy.
Truth behind it Magento is resource intensive Magento is based on EAV database model means to retrieve a singleinformati...
Solution Identify the server resources available. – Type of hosting server, Webserver, RAM, CPU etc Product catalog – Nu...
Optimization through Magentoconfiguration.htaccess configurationWeb server and browserconfigurationMySQL configurationSolu...
Optimization through Magento configuration Use flat catalog navigation. Using this, we address EAV data model issue for ...
Optimization through Magento configuration How to enable flat catalog navigation?System->Configuration->Catalog {Frontend...
Optimization through Magento configuration Merge JS and CSS files. Using this option, we address issue of multiple HTTP ...
Optimization through Magento configuration How to merge JS and CSS files?System->Configuration->Developer {JS, CSS settin...
Optimization through Magento configuration Compile Magento. Using this option, we address issue of loading large framewo...
Optimization through Magento configuration How to compile Magento?System->Tools->Compilation
Optimization through Magento configuration Disable Magento logs Using this option, we address issues consuming more CPU ...
Optimization through Magento configuration How to disable logs?System -> Configuration -> Advanced -> Developer {Log Sett...
Optimization through Magento configuration Enable Magento cacheSystem -> Cache Management Helps in loading website faster
.HTACCESS tweaks Enable gzip compression<IfModule mod_deflate.c>AddOutputFilterByType DEFLATE text/html text/plain text/x...
.HTACCESS tweaks Enable Apache KeepAlive and disable EtagFileEtag NoneKeepAlive OnMaxKeepAliveRequests 100KeepAliveTimeOu...
Web server and browser configuration Use Varnish Cache. Use PHP cache accelerator like APC, eAccelerator, Xcache. Use C...
MySQL configuration Increase InnoDB buffer pool - Magento uses InnoDB storage enginewhich, uses memory pools to cache tab...
MySQL configuration Enable query cache - MySQL can cache results for queries and returnit from cache, when identical quer...
Performance measuring & optimization tools Magento speed testerURL - http://www.magespeedtest.com Speed monitoringURL - ...
Q&AEmail: ashish@ranosys.comLinkedin: http://sg.linkedin.com/in/ashishpurohitin
Upcoming SlideShare
Loading in...5
×

Magento e commerce performance optimization

1,474

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,474
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
43
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Magento e commerce performance optimization

  1. 1. Magento eCommerce Performance OptimizationAshish PurohitRanosys Technologies Pte Ltd30 Apr 2013
  2. 2. What we will discuss today? What is Magento? Comparison with other eCommerce platform What people think about Magento? Performance optimization Tools and utilities
  3. 3. What is Magento? Open source rich eCommerce platform developed on PHP Zendframework First stable release in 2008 by Varian now known as Magento Comes in three variant Community edition Magento Go – Magento hosted solution Enterprise edition Acquired by eBay in 2011 More than 4 million downloads after first stable releaseFlexible Extendable Modular Upgradable Scalable
  4. 4. Comparison with other platform
  5. 5. Comparison with other platform Magento is leader in this domain.
  6. 6. What people think about Magento? User experience is leggy.
  7. 7. Truth behind it Magento is resource intensive Magento is based on EAV database model means to retrieve a singleinformation we need to go through many queries and tables. Giant XML trees in memory and then "querying" those same trees forinformation. This takes both memory (storing the trees) and CPU (parsingthe trees). Some of these (especially the layout tree) are huge. Also,unless caching is on, these tree are built up from files on disk and oneach request. Magento uses its configuration system to allow you to override classes.This is a powerful feature, but it means anytime a model, helper, orcontroller is instantiated, extra PHP instructions need to run to determineif an original class file or an override class files is needed. This adds up.
  8. 8. Solution Identify the server resources available. – Type of hosting server, Webserver, RAM, CPU etc Product catalog – Number of categories, products etc Number of expected simultaneous usersUnderstand critical parameters for making optimization strategyOptimization methods are available/ applicable dependingupon the nature of web server and Magento store
  9. 9. Optimization through Magentoconfiguration.htaccess configurationWeb server and browserconfigurationMySQL configurationSolutions
  10. 10. Optimization through Magento configuration Use flat catalog navigation. Using this, we address EAV data model issue for running multiplequeries. When enabled, it store products and category information inone table for each. It is recommended to use flat category navigation in allMagento website Flat product navigation will be helpful when you have more than1000 SKUs
  11. 11. Optimization through Magento configuration How to enable flat catalog navigation?System->Configuration->Catalog {Frontend option}
  12. 12. Optimization through Magento configuration Merge JS and CSS files. Using this option, we address issue of multiple HTTP requests. When enabled, it merge all JS and CSS files and reduce HTTPrequests. Important: While enabling this feature you may face issue ofJavascript confliction when multiple JS frameworks used.
  13. 13. Optimization through Magento configuration How to merge JS and CSS files?System->Configuration->Developer {JS, CSS settings}
  14. 14. Optimization through Magento configuration Compile Magento. Using this option, we address issue of loading large framework inbackground by running through multiple directory structure. When enabled, it merge various PHP files into one large file andstore them on location “includes/src”. Therefore instead ofreading multiple directories on entry point it will look at onlylocation. It improves Magento performance by 25-40%. Important: Once enabled, you can’t upgrade Magento storeand modify any core settings including core files. If you want todo then decompile Magento first and modify it.
  15. 15. Optimization through Magento configuration How to compile Magento?System->Tools->Compilation
  16. 16. Optimization through Magento configuration Disable Magento logs Using this option, we address issues consuming more CPU cycleand diskspace. When enabled, Magento stops writing logs for any error orexception. If any time needed for debugging then we canenable it again.
  17. 17. Optimization through Magento configuration How to disable logs?System -> Configuration -> Advanced -> Developer {Log Settings}
  18. 18. Optimization through Magento configuration Enable Magento cacheSystem -> Cache Management Helps in loading website faster
  19. 19. .HTACCESS tweaks Enable gzip compression<IfModule mod_deflate.c>AddOutputFilterByType DEFLATE text/html text/plain text/xmltext/css text/javascriptBrowserMatch ^Mozilla/4 gzip-only-text/htmlBrowserMatch ^Mozilla/4.0[678] no-gzipSetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary</IfModule> Use header expires<IfModule mod_expires.c>ExpiresActive OnExpiresDefault “access plus 1 month“ExpiresByType image/x-icon “access plus 1 month”ExpiresByType text/html “access plus 1 month”ExpiresByType image/plain “access plus 1 month”ExpiresByType image/css “access plus 1 month”ExpiresByType application/x-javascript “access plus 1 month”ExpiresByType application/x-shockwave-flash “access plus 1month”</IfModule>
  20. 20. .HTACCESS tweaks Enable Apache KeepAlive and disable EtagFileEtag NoneKeepAlive OnMaxKeepAliveRequests 100KeepAliveTimeOut 5
  21. 21. Web server and browser configuration Use Varnish Cache. Use PHP cache accelerator like APC, eAccelerator, Xcache. Use CDN to deliver static contents of your websites. Do not use too many external sources for images, iframes. Install only minimum required modules on server. Deploy on Nginx or Litespeed server. It is recommended not to use Magento on cheap hosting.
  22. 22. MySQL configuration Increase InnoDB buffer pool - Magento uses InnoDB storage enginewhich, uses memory pools to cache tables data, indexes to reducedisk I/O. Less disk I/O means faster access to data, indexes etc. Thekey is to assign as much memory as possible for in-memory cache.innodb_buffer_pool_size = 512M Multithreading - Innodb can use multiple cores of server processors togive concurrent connection. The key is to use this ability to boostconcurrent connections. Magento recommends to calculate“innodb_thread_concurrency” value by equationinnodb_thread_concurrency = 2 x [# of CPUs] + 2
  23. 23. MySQL configuration Enable query cache - MySQL can cache results for queries and returnit from cache, when identical query is done. For example queriesrunning for home page will be almost identical for another homepage view. Enabling the cache can save a lot of rework on MySQLend.query_cache_size = 32M Enable sort buffersort_buffer_size = 4M
  24. 24. Performance measuring & optimization tools Magento speed testerURL - http://www.magespeedtest.com Speed monitoringURL - http://mon.itor.us/URL - http://www.pingdom.com/ Fooman Speedster – For combining, compressing and caching JSand CSS files.URL - http://www.magentocommerce.com/magento-connect/FOOMAN/extension/457/fooman-speedster Page cache – with full page cache which is by default notavailable in community edition of Magento.URL - http://www.magentocommerce.com/magento-connect/pagecache-powered-by-varnish.html
  25. 25. Q&AEmail: ashish@ranosys.comLinkedin: http://sg.linkedin.com/in/ashishpurohitin
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×