MageHost - Magento 2 profiling

Gewijzigd op Tue, 20 Dec 2022 om 01:04 PM

Disclaimer: MageHost has joined forces with Savvii. Therefore, these articles are only relevant to existing MageHost customers. For more information on this, visit www.savvii.com/en/magehost.  


PHP and MySQL related performance issues can be hard to track down. Luckily, Magento 2 comes with its own profiler to help you do this. The built-in profiler should only be used on a Staging account since it has an impact on performance and it shows debugging information on the pages of your webshop.

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 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

5. Hit the page where the problem persists again

  1. Scroll to the bottom of the page, there is a table with load times
  2. Find the element with the highest value in the 'Time' column
  3. You will now have a good indication where the most time is spent

6. 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