1

I am looking for best practice/ good ways to help to identify slow points on Magento loads on a local machine. I think what I am mainly looking for is identifying items that are causing slow time to first byte.

  • 2
    Enable the profiler. It should give you at least an idea where the bottleneck is. – Marius Aug 20 '14 at 13:21
2

On a local machine is actually harder, when you don't have an idea what pages to look at. If it's a copy of a production site, I recommend installing New Relic in production and let it collect some data. Make sure your robots.txt disallows category filters as it will skew your results. The reason for this is that search engines will try all combinations available to them and request nothing but category pages for several days. In reality, your visitors and (future) customers, should not be spending that much time in your category alone.

Once setup correctly, it should give you an idea with what your visitors are having issues with. If you have a New Relic Pro account, you will also get transaction traces giving you a good starting point.

Now, if you do not have production data to work with, first and foremost identify the nr. 1 issue:

find app/design/frontend -name '*.phtml' -exec grep -- '->load(' {} +

As of last friday, I'm adding:

find app/design/frontend -name '*.phtml' -exec grep -- '->cleanCache(' {} +

Then install:

  • n98-magerun
  • Aoe_Profiler and make sure no IPs or your IP is in developer restrictions. (n98-magerun config:set dev/restrict/allow_ips "")
  • xdebug
  • At minimum twice as much memory for php then you normally would need.

To test the site's performance, I use a little script that I've made available as a gist.

When you see a URL that goes above your threshold, simply run it in your browser with ?profile=1 appended to it and you should be able to get an idea where to start optimizing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.