1

The TTFB is on 29 seconds and its taking 55+ seconds to load the product detail page.

We have varnish cache enabled, product mode enabled, JS and CSS minified already and expiry headers and other optimizations are also completed.Please check the attached image for timings

We have around 300K products. Do you have any suggestions?

2
  • i think image size high. so this problem. Commented Jun 18, 2020 at 12:00
  • Thanks @MohitPatel. No, it's already optimized
    – Manpreet
    Commented Jun 18, 2020 at 12:01

2 Answers 2

2

Varnish will help your site only if the backend is healthy: meaning your dev environment loads reasonably fast. Then, varnish will enable your production site to have recurrent visits for the same page, non-private features to be reloaded from the cache.

Likely, all this is something you know but I am trying to emphasise that it is essential to have a healthy backend to consider whether your site has optimisation issues.

to verify whether the backend is healthy, you might want to use profiling systems (Magento default profiler is very useful in my experience because it just focuses on php). Then, the idea is to tackle in the profiler the calls that take the longest.

  • if some third-party modules are culprit, then code review them and sort these out
  • if Magento core is the culprit, you may check here for specific point but a quick win will likely to increase the horses in your server (that often works especially with 300K products)

Of course, further down the line, you may look at frontend optimisations but the report you show us seems to indicate your backend is the longest at the moment

UPDATE: if mysql is the issue, it does not necessarily mean mysql needs tuning. We may also consider that we call mysql too often. My initial search for code optimisation is find the word "repository" and "load(" in the codebase (I appreciate there are many of these..), but the ones that are part of a loop can often be a starting point to optimise by using collections.

4
  • We have already set up the default profiler and xhprof profiler but it's not showing specific file which we can use to debug. According to the report, the MySQL is taking time, please check this screenshot: prnt.sc/t2301c
    – Manpreet
    Commented Jun 18, 2020 at 13:14
  • check this in this case magento.stackexchange.com/questions/148808/…. I have updated my answer Commented Jun 18, 2020 at 13:17
  • Thanks @Herve, we got some queries which are taking between 4 secs to 8 secs.
    – Manpreet
    Commented Jun 18, 2020 at 14:25
  • that's these that you want to tackle indeed.. Commented Jun 18, 2020 at 14:48
0

First thing you need to do is to enable the profiler and check which query is taking so long. Its possible that the code written in the product page template is not optimized.

I can see you are already using debugging extension. Did you check the Yslow part?

Even though you have turned on the Varnish Cache, but its still possible that the page is not caching. You will need to check it in Network Tab, HIT/MISS.

Make sure there is no cacheable="false" in product page layout file.

2
  • We have already set up the default profiler and xhprof profiler but it's not showing specific file which we can use to debug. According to the report, the MySQL is taking time, please check this screenshot: prnt.sc/t2301c
    – Manpreet
    Commented Jun 18, 2020 at 13:14
  • Yes, cacheable is already verified and it's not existing.
    – Manpreet
    Commented Jun 18, 2020 at 13:15

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.