Magento Performance Tips [Rare]

0 Flares 0 Flares ×

By now you must have gone through tons of optimization tips related to Magento but here I am going to share my personal experience of fighting with Magento and these tweaks really helped me to improve overall Magento performance and good thing is most are also applicable to most of other PHP+Mysql based applications.

I was stuck with performance issues and I tried almost all the common suggestions spread over different sites and forums but I was still not able to achieve and fix some of issues. So what I did?

  1. Get a faster clock speed per core and latest generation CPU. Believe me no of cores and amount of Memory sound good on paper but they will only help you when you have to handle more no of visitors at given time but if you want to decrease PHP page generation time then only faster clock speed core will help you as normal visitor’s request is handled by only a single core so a faster core can only finish the job in lesser time.
  2. No one can beat the power of a Physical server so always go for a Dedicated server instead of Cloud or VPS or any type of virtualized server if you can design a reliable Disaster Recovery plan.
  3. If you have enough computing power on your web server then always go for local Mysql instance as it will provide you better performance compare to remote Mysql server.
  4. Move Magento ‘cache’, ‘full_page_cache’ and ‘session’ folder on a ‘tmpfs’ based RamDisk. I was having random high IOPS issues and moving them to RAMDisk sorted it.
  5. If you seeing high percentage of Mysql temporarily tables created on disk despite keep increasing ‘tmp_table_size’ and ‘max_heap_table_size’ values then most probably your application is using much TEXT and BLOB columns so allocating more memory won’t help you and in that case you can try moving Mysql ‘tmpdir’ to a RAMDisk (with caution).
  6. Play with XFS or EXT4 filesystems and see which work best with your environment.
  7. Upgrade PHP to 5.5 and use OPcache instead of APC or APCu.
  8. Upgrade Mysql to 5.6
  9. In case of Apache move all .htaccess rules to virtual host, you can try with ‘AllowOverride None’ altogether.
  10. Disable Mysql slow query log and binlog.
  11. Disable PHP slow_log.
  12. Disable Magento System and Exception logs as well as Profiler.
  13. You can also try mounting Mysql ‘data’ directory and ‘/var/www/’ with ‘noatime’ option.
  14.  Prefer using “Unix Socket” for PHP-FPM and Mysql over TCP/IP. Same applies to ‘Redis’ and “Memcached”.
  15. Create all unix sockets in RAMDisk (tmpfs) instead of disk.
  16. If you are seeing random 502, 499 errors in nginx (while CPU, Memory, I/O, database etc looks stable) with PHP-FPM “Unix Socket” then switch to TCP/IP or increase listen.backlognet.core.somaxconn and ulimit values.
  17. Try newer PHP Mysql driver ‘mysqlnd’ over ‘libmysql’.
  18. Try PHP memcached driver over memcache
  19. Setup “Parallel Downloads” for different type of content.
  20. Setup HTTP/2 or SPDY to improve HTTPS performance.
  21. Use external Analytics like GA.
  22. Properly setup robots.txt and block bad bots and private areas of site and define a crawl delay.
  23. Replace regular Search and Layered Navigation from Solr or Sphinx, I personally using Algolia.
  24. Setup scheduled “Magento Log Cleaning”.

Obviously along with above suggestion you still need to apply all those tweaks and tips which you already know most.

0 Flares Twitter 0 Facebook 0 LinkedIn 0 Google+ 0 0 Flares ×

Leave a Reply

Your email address will not be published. Required fields are marked *