Question: Do I have too many queries?

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 5 months ago #342800

Hi,

I wanted to know if you think it is acceptable for a Joomla and Hikashop site (with Falang) to load 400 queries each time.
I currently have slowdowns that occur punctually during the day (often between late morning and early evening).

There is no cache enabled as some pages were not working properly when it was active.
I know you would need a lot more information, but are there any optimizations I could consider?
I have tried JCH Optimize without much success.

Personal hypothesis (but nothing sure and I may be missing the real problem):
I have the impression that at certain times requests take longer to complete (>100 times the normal duration) when I test a query directly (the website is hosted by Infomaniak -in shared hosting-, but they do not detect any abnormal load on the hosting server).
I wonder if it is the MySQL server that is overloading.

If you have any ideas, I'm interested.

This message contains confidential information


Thank you in advance.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 5 months ago #342802

Hi,

Well, I had a look at your test website pages and all the pages displayed fast.
300 queries is a lot compared to a blank page but that's normal: you have several listings of the page, the cart, and Falang.
Falang itself adds easily 50 queries to the page (in order to load the translations).
And each listing adds 50 queries (loading the products, the categories, the prices, the discounts, the taxes, the options, the variants, the images, the badges, etc).
And even a bare Joomla with nothing installed on it will still run several dozens queries on any given page.

First, to better understand the issue, you would have to activate the debugger on a page which is slow to display.
That way, the debugger would show useful information on what part of the process is slow and allow us/you to better pin point the bottleneck.

The following user(s) said Thank You: FDBI

Please Log in or Create an account to join the conversation.

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 5 months ago #342822

Hi,

Thanks a lot for your answer and to reassuring me.

At the moment I'm focusing on the home page:
With cache disabled I have 400 queries (without: 268 but maybe with problems).

I think I can gain some performance if I can cache only certain parts.
I'm thinking about how to set this up.

But even if I manage to save the execution of half of the requests (and less files to load): I don't see how I can gain more performance than a page that would load twice as fast and that won't be enough.

Because at the moment there is no problem, so the page is displayed in less than 1 second (or around 1.5 seconds), but there are times when the same page takes more than 5 or 10 seconds (sometimes more).

My host tells me that the hosting server has no problem, that it is not overloaded and that the site should be optimised.

This message contains confidential information

For me, the main problem (TTFB slow) can also come from the server. (And if not, the problem would be present more regularly in my opinion.)

What I find strange is that the same site with the same host, but on a different server (different hosting), I didn't have as many problems.
The main difference is maybe that there are obviously more visitors than on the test sites, or a underperforming server.

And when the site slows down, the SQL queries I do manually are >100 times slower.
For me, the MySQL server is slowing down.

That's why I'm trying to find solutions to reduce my number of queries.

Last edit: 2 years 5 months ago by FDBI.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
2 years 5 months ago #342828

Hi,

While it certainly is interesting to try to improve performances all you provided doesn't help at all in understanding where the problem when you website slows down.
You can only check what is the problem by looking at the debugger while the website rendering is slow.

Also, GTMetrix says the page takes 3 seconds, but the generation of the page is only 1 second for Joomla.
And on that 1 second, one third of the time is taken up by the RCA product carousel module.
You could try to not use this module, and instead use a normal HikaShop content module and use its "enable carousel" setting. You should be able to achieve the same look and hopefully our code to load the products is more optimized than theirs.
However, I think you'll spend hours on this and while it will potentially improve your score on GTMetric, it probably won't change anything for the times where your website loads slow.

Again, to get to the bottom of the problem, you need to look at the debugger data while the website is loading slowly.

The following user(s) said Thank You: FDBI

Please Log in or Create an account to join the conversation.

  • Posts: 148
  • Thank you received: 21
  • Hikashop Business
2 years 5 months ago #342852

Hi,

Yes, thank you.
It's very clear, I completely agree with all this.

The RCA product carousel module comes with the "ShopIn Joomla! Template for HikaShop & VirtueMart", the template that I use.
But if I try to do it without, I would indeed start with the "normal HikaShop content module " and it will be easier to maintain too I think.

Thanks again, I'll look into it.

Last edit: 2 years 5 months ago by FDBI.

Please Log in or Create an account to join the conversation.

Time to create page: 0.045 seconds
Powered by Kunena Forum