How to spot slow running Extensions in Magento
Knowledgebase Article
}
Knowledgebase Article
One of the great things about Magento is how extendable it is, with tons of 3rd party extensions available.
Many of these extensions are professionally coded, but there are also plenty of bad eggs out there that can significantly harm your site speed.
If you’re site is slow and is otherwise well optimised, try disabling some of your unrequired modules/extensions.
Advanced users can also use Magento’s Varien Profiler to analyse what aspects in the site’s code are causing performance bottlenecks.
It monitors the time and memory allocation of your application loading cycle at specific intervals you set.
IMPORTANT NOTE:
Profiler should never be run on production sites, as it exposes exactly how a page loads, and this can provide intimate details of how your system is configured; information that would be highly valuable to anyone trying to compromise your store.
As such, it should only be run in a development environment.
To turn the “Profiler” on go to: System >> Configuration >> Advanced >> Developer >> Debug >> Profiler >> set to Yes:
At this point the Profiler is switched on, but we need to tell it what to profile.
The default catch-all solution is to edit Magento's index.php file, find the line:
#Varien_Profiler::enable();
near the bottom and and un-comment it (remove the hash sign #).
Now reload any Magento page and scroll down to the bottom where you will see a link “[Profiler]”.
Click on it, it will expand to table that shows statistics about Time, number of execution and memory used for each watched fragment of the code:
You should see a table with the following headers: “Code Profiler“, "Time", “Cnt“, “Emalloc“, “RealMem“.
“Code Profiler” column basically holds the value of the timer name.
"Time" stands for time taken by the block of code to execute.
“Cnt” column stands for “count”, and it holds the integer value of how many times have you “started” your timer with the same name.
“Emalloc” column stands for “Amount of memory allocated to PHP”. Its a mix of core PHP memory_get_usage() function without “true” parameter passed to it, minus timer values.
“RealMem” column also stands for “Amount of memory allocated to PHP” whose final value is also obtained trough memory_get_usage(true) function minus timer values but this time with “true” parameter passed in.
To enable SQL profiling, open the Magento local.xml config file and add:
<profiler>true</profiler>
under the connection node:
You'll get the SQL stats at the bottom of the Profiler output:
That's how to spot slow running Extensions in Magento. Should you need any further assistance, please do not hesitate to contact us.
Powered by WHMCompleteSolution