0

I know it's kinda vague, but I have a website and all works fine, unless the page "See All" as well as the search and filters, are all very slow. If it's in cache it opens in a second but if it isn't it takes so much time.

it only happens to this page but it a catalog page anyway, I don't know where to check.

Thanks! Best regards, Rui Silva

1
  • The most likely cause is missing indexes. Discovery is frequently done with a Slow Query Log to identify the slow queries, and then use EXPLAIN SELECT ...... to find access of tables and finding high row EXAMINED counts is the most likely cause. Commented Jan 22 at 10:21

3 Answers 3

1

Sometimes this is caused by having too many filterable/ searchable attributes, so it's worth a try to verify this.

But what I suggest on a more granular scale is to install blackfire.io tool and to profile the pages you mention. The profiling results will provide a detailed graph where you will be able to see which are the classes and methods used and where is the time spent inside them.

Good luck!

2
  • 1
    Hey, I found the problem, was with an extension that make it slow when we had a lot of products using it. But that recommendation is very good, I'll accept since tha tool might help a lot of people!
    – Rui Silva
    Commented Mar 23, 2021 at 14:30
  • Glad you sorted things out! Keep rocking!
    – Diana
    Commented Mar 23, 2021 at 18:40
0

Not all pages are cached and this applies in most cases ot search result and filtered results.

So you need to optimize on these.

How this can be achieved : use Elastic search, Save search results , upgrade to 2.4.x as this will have Mysql 8.x which is faster. Check searchable attributes and there configuration related to search.

Reduce number of search result and use lazy loading or pagination

0

What you need is a PHP code profiler.

This thing analyzes code and shows slow parts. Below is a typical callgraph and call diagram for a sample Magento 2 page:

enter image description here

enter image description here

By analyzing a callgraph you can find a slow code part.

Magento 2 comes with a built-in profiler but it's functionality is limited. You can enable Magento 2 profiler with a following CLI command:

bin/magento dev:profiler:enable html

Then disable it when a need be:

bin/magento dev:profiler:disable

You can try an online profiler (tideways, new relic or similar, just google for them), they are better than a built-in one.

Also, from my experience providing optimization service, I came across lots of slow Magento 2 sites. In most of the cases it's some 3rd-party plugin that slows the site down.

What you can try is a 3rd-party extension audit. Try turning off all extensions and see if it makes a speed difference. If it does - turn them on one by one and see which module(s) breaks performance.

Last but not least, try switching to a Luma theme. If it speeds thing up - then you know your theme is a problem and it needs to be further investigated.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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