Magento 2 profiling

Gewijzigd op Wo, 7 Okt om 1:08 PM

Magento 2 profiling

PHP and MySQL related performance issues can be hard to track down. Luckily, Magento 2 comes with its own built-in profiler to help you do this. Only use it on a Staging account: it has a performance impact and it shows debugging information on the pages of your webshop. It also needs to run in developer mode (which staging normally uses) to produce the HTML output.


Below are the steps to enable the profiler and track down issues:

  1. Make sure your code on Staging is in sync with production

  2. Make sure your database on Staging is in sync with production

  3. Reproduce the issue on staging, for example go to a slow page. To make sure you don't hit Varnish or the full-page cache, add ?no_cache=1 to the end of the URL

  4. Use SSH to go to the Magento 2 directory and execute:

    bin/magento dev:profiler:enable html  
    # html is the profiler output type — don't omit it
  5. Hit the slow page again

  6. Scroll to the bottom of the page, there is a table with load times

  7. Find the element with the highest value in the 'Time' column

  8. You will now have a good indication where the most time is spent

  9. To disable the profiler, use SSH to go to the Magento 2 directory and run:

    bin/magento dev:profiler:disable

Was dit artikel nuttig?

Dat is fantastisch!

Hartelijk dank voor uw beoordeling

Sorry dat we u niet konden helpen

Hartelijk dank voor uw beoordeling

Laat ons weten hoe we dit artikel kunnen verbeteren!

Selecteer tenminste een van de redenen
CAPTCHA-verificatie is vereist.

Feedback verzonden

We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren