<

3 working tips to increase Magento speed

Published on
3,427 Points
327 Views
1 Endorsement
Last Modified:
Konstantin Gerasimov
Magento developer and website performance specialist.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
E-commerce site speed is important. Not only fast sites convert better but they also tend to rank higher in google search engine.

Magento is a popular eCommerce content management system which is free and open source. There are two major versions of it: 1.x and the latest 2.x release. It is ideal for small to mid-size online businesses wanting to offer e-commerce experience to their customers.

Magento 1.x is known for its sluggish performance. Just google for 'Magento slow' and you will find a dozen store owners complaining their site isn't fast enough. 


Disclaimer: The following points apply to Magento 1.x only. Magento 2 was designed to be fast (unlike Magento 1.x) and if it is not for you please leave a comment at the bottom of this article - I will help.
 


1. Optimize time to first byte (TTFB)


Time to first byte as defined by webpagetest.org:


...is the time from the start of the initial navigation until the first byte of the base page is received by the browser (after following redirects).


1.1 Enable Magento Profiler



Magento offers a way to measure and audit TTFB for every page by using its built-in profiler feature. Here is how to enable it:

1. Edit index.php and uncomment Varien_Profiler::enable line like this:
Screen-Shot-2017-01-19-at-17.32.14.png2. Go to backend main menu System > Configuration > Advanced > Developer > Debug > Profiler and set it to Yes:
Screen-Shot-2017-01-19-at-17.33.57.pngOnce you did #1 and #2 you should see profiler output at the bottom of every page you visit:

Screen-Shot-2017-01-19-at-17.37.54.pngAlternatively you can install Aoe_Profiler extension and have it all wrapped up in a nice backend Magento grid.
 

1.2 Audit Profiler Output



Go through profiler output line by line and see what is taking more than 0.1s. 0.1s threshold is subjective - analyze everything you think has to be analyzed.

Common issues found with profiler help:

1. A third-party extension event observer takes too long - you installed an extension from Magento connect and some of its code is run on every page request slowing you down. Do you really need this plugin? Try contacting vendor or replace it with another one.

2. Template .phtml file is slow - that is a sign of a poor coding. Go through the file and audit PHP code. Common problem - loading a Magento model inside a loop (say Mage::getModel('catalog/product')->load($product_id)) - I see it too often:)

3. A function called too many times - profiler output has Cnt column that shows how many times a function call has been executed. Pay attention to that column. If Cnt is over 100 - that is a red flag. Check out the corresponding code lines and see if there is a room for improvement.
 


2. Optimize server environment


Next thing (actually that should be #1 on your list) to focus on is server environment. 
 

2.1 Magento Optimized Hosting



Go for Magento optimized hosting not just an average $10/mo shared account. That will pay off. A few examples are Nexcess and Magemojo. Use google search and find a company you like. 
 

2.2 PHP7



PHP7 is out and its performance benefits in comparison to PHP5 are proven.

Magento 1.x supports PHP7 with the help of Inchoo patch.
 

2.3 Redis



Redis is in-memory data store engine.

Magento can use Redis as cache / session backend. Here is an official instruction on how to set it up.

Redis helps speed up product saving, checkout process and many other Magento operations - proof by Nexcess.

 

3.  Full Page Cache extension


Magento 1.x Community Edition doesn't have full page cache extension. Enterprise edition does. For a reason - it really helps speed up the site and improve user experience.

Full page cache (FPC) stores full pages in cache and serve them as fast as static content. 

Although I often say CACHE != PERFORMANCE I still recommend getting and installing FPC on your Magento store.

Browser for available FPC extensions on Magento connect and pick the one you like.
 
1
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month