Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Methods and Best Practices for High Performance eCommerce

17,517 views

Published on

Magento HQ Developers Meet up, Los Angeles, September 16

Published in: Technology

Methods and Best Practices for High Performance eCommerce

  1. 1. Magento HQ Developers Meet up<br />Methods and Best Practices for High Performance eCommerce.<br />By Dmitriy Soroka<br />System Architect at Magento, Inc<br />20-Sep-10|<br />1|<br />
  2. 2. Performance Improvement Techniques <br />Environment<br />Web Server Configuration<br />Data Base Configuration<br />Accelerating PHP<br />Additional HTTP Requests<br />Application<br />Caching<br />Session Handling<br />More options<br />Scaling<br />Backend Server<br />Multiple Frontend Servers<br />Multiple Databases<br />3rd party integrations<br />Integration with Solr<br />
  3. 3. Benchmarks Methodology<br />Siege with different concurrencies<br />10, 20, 50, 100<br />Database Size<br />Sample data, 10K products, 80K products<br />URLs<br />CMS Page (home page)<br />URLs List<br />Checkout<br />Results<br />Requests per second<br />Orders per hour<br />
  4. 4. Environment optimization<br />Apache, MySQL, PHP<br />
  5. 5. Apache Configuration<br />Apache modules – use just necessary modules<br />KeepAlive directive<br />mod_deflate - compress content before sending it to the browser<br />Eliminating directory structure scans for the .htaccess<br />
  6. 6. MySQL Configuration<br />innodb_buffer_pool_size<br />Combined web and db server, 6 GB RAM – 2-3 GB<br />Dedicated database server, 6 GB RAM – 5 GB<br />Dedicated database server, 12 GB RAM – 10 GB<br />innodb_thread_concurrency<br />2 * [numberofCPUs] + 2<br />table_cache is the number of tables that can be simultaneously opened by MySQL<br />query_cache_size (64 Mb)<br />query_cache_limit (2 Mb)<br />
  7. 7. Optimization Results<br />
  8. 8. Accelerating PHP<br />File system structure optimization<br />APC<br />eAccelerator<br />Zend Optimize<br />Xcache<br />
  9. 9. Magento Compiler<br />
  10. 10. PHP Accelerators<br />
  11. 11. Additional HTTP Requests<br />CSS<br />Java Script<br />Images<br />
  12. 12. Application optimization <br />Cache, Sessions<br />
  13. 13. Cache Types<br />
  14. 14. Cache Enables vs. Cache disabled<br />
  15. 15. Cache Storages<br />Memory Based<br />File System Based<br /><ul><li>File
  16. 16. Sqlite
  17. 17. Database (MySQL)
  18. 18. ZendServer disk
  19. 19. APC
  20. 20. Memcached
  21. 21. xCache
  22. 22. eAccelerator
  23. 23. ZendServer Memory</li></li></ul><li>Two Levels Backend<br />Two Levels Backend<br />Slow level<br />Fast level<br />
  24. 24. Cache Configuration<br /><config><br /> <global> <br /> <cache><br /><!-- apc / memcached / xcache / empty=file --><br /> <backend></backend><br /> <prefix|id_prefix></prefix|id_prefix><br /> <backend_options><br /> <option_code1>option_value1</option_code1><br /> </backend_options><br /> <frontend_options><br /> <option_code1>option_value1</option_code1><br /> </frontend_options><br /> <memcached><br /> <servers>....</servers><br /> <memcached><br /> </cache><br /> </global><br /></config><br />
  25. 25. Slow Backend<br /><config><br /> <global> <br /> <cache><br /> <slow_backend>database</slow_backend><br /> <slow_backend_options><br /> <option_code1>option_value1</option_code1><br /> </slow_backend_options><br /> </cache><br /> </global><br /></config><br />
  26. 26. Storages Benchmark<br />
  27. 27. Full Page Cache (CMS page)<br />
  28. 28. Full Page Cache (urls list)<br />
  29. 29. Session Storage<br />Files Memcached Data Base<br />
  30. 30. More…<br />Flat Catalog<br />Sales Archive<br />Backend processes (cron, indexes)<br />Theme complexity<br />
  31. 31. scaling<br />Hardware, Web Nodes, Data Base<br />
  32. 32. Hardware<br />
  33. 33. Separate Backend Server<br />Data Base<br />Handle admin users<br />Process backend activity (cron)<br />Pre generate Full Page Cache<br />Handle media queries<br />
  34. 34. Multiple Web Nodes (browsing)<br />
  35. 35. Multiple Web Nodes (checkout)<br />
  36. 36. Data Base<br />config/global/resources<br /> <default_setup><br /> <connection><br /> <host><![CDATA[master]]></host><br /> <username><![CDATA[writeuser]]></username><br /> <password><![CDATA[writeuserpwd]]></password><br /> <dbname><![CDATA[magento]]></dbname><br /> <active>1</active><br /> </connection><br /> </default_setup><br /> <default_read><br /> <connection><br /> <use></use><br /> <host><![CDATA[slave]]></host><br /> <username><![CDATA[readuser]]></username><br /> <password><![CDATA[readuserpwd]]></password><br /> <dbname><![CDATA[magento]]></dbname><br /> <model>mysql4</model><br /> <initStatements>SET NAMES utf8</initStatements><br /> <type>pdo_mysql</type><br /> <active>1</active><br /> </connection><br /> </default_read><br />
  37. 37. 3rd party integrations<br />Solr<br />
  38. 38. Using solr<br />Spell checking<br />Search suggestions<br />Morphology<br />Category navigation<br />Facet navigation<br />
  39. 39. Benchmark Results<br />
  40. 40. Magento HQ Developers Meet up<br />Thank You<br />Email: dmitriy.soroka@varien.com<br />
  41. 41. Q&A<br />

×