• Closed by: Anonymous Submitter
  • Closed on:
  • Reason: Not a bug

Ticket #24089 - Occasional overly long load times when loading product lists

The problem arises in the main page https://escala-18.com/ there is a long page filled with products made with the page builder, it’s essentially a group of “product list” items.

Most of the time the site loads without issue, taking about a second or so, no problem. However, at times and for reasons I can’t understand, the site takes way longer to load, jumping from 1-2 seconds to about 8 or more than 10 seconds, which is far too long of a loading time.

The problem is not entirely random (a user reports it happens rather consistently when accessing it through his phone) and I suspect it has to do with the caching system, since those times and the load times with disabled caching seem to be about the same, but as I understand, the site should be cached to begin with and a user shouldn’t face a 5+ sec loading time out of the blue, even more so if he has accessed the webpage a moment ago. That said these are nothing but my speculations and I’d hope you could provide more insight on what the problem might be.

The problem can also be occasionally replicated by changing the language of the site.

Thanks for your attention and I wish you happy holidays.


Fred 27 Dec 2022, 15:46

Hi, Unai G. Ansotegui - Ruben S. Alvarez Sociedad Civil.
First of all the home page you have is huge and of course to get all the data from database take some time. It’s happening only if cache is empty in other cases (usual website navigation) it works pretty fast - https://take.ms/2Mju7 Cache is clearing in these cases - https://take.ms/wNATw So I can only advice you after updating category/product in your back office just open front page to refresh the page

We have removed Page Builder from our theme over 1 year ago module because is too outdated (developed in 2013) has low performance and poor functionality.
Now we are using modern Creative Elements module instead

Unai G. Ansotegui - Ruben S. Alvarez Sociedad Civil 28 Dec 2022, 16:34

I agree that’s at least that’s how it ought to work, but our client insists that he often encounters the mentioned slowdowns.

Here is what I’m going to do: The page currently writes a log whenever the load time exceeds a time (8 seconds if I recall correctly), I’m going to write another whenever the cache is cleared in the manner described by your second image. If the times in which the cache is cleared due to admin work match with the times in which the slowdown happens, then all that is left is informing the client that that’s just how it works, otherwise I’ll stay on the detective work.

In the meantime, I presume there is no accessible way to regenerate all of the cache before users visit the relevant sites, is there?

Glad to have your assistance.

Fred 28 Dec 2022, 16:51

Ok, let me know the result of your testing, in case of the problem on our side we will try to help you to resolve it.
Here I have found a solution to warmup prestashop cache https://canonicalized.com/prestashop-speed-optimization/?section=cache-module

Unai G. Ansotegui - Ruben S. Alvarez Sociedad Civil 06 Feb 2023, 19:37

Hey, hope the new year has been good to you. Sorry for the long delay.

Long story short, yeah it seems slowdowns happen after cache clear because the page is just way too large, we have instructed the client to try to keep it lean. Ought to be smooth sailing from then onwards.

That said, the server often report bugs related to exceeding the amount of database connections available. This seems unrelated to the previous problem to me so if I ought to make a new ticket for it please do mention it.

[02-Feb-2023 14:16:11 Europe/Madrid] PHP Fatal error:  Uncaught PDOException: SQLSTATE[HY000] [1226] User 'myescala1' has exceeded the 'max_user_connections' resource (current value: 15) in /usr/home/escala-18.com/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /usr/home/escala-18.com/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=loca...', 'myescala1', 'CCkLDZ4O', Array)
#1 /usr/home/escala-18.com/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(44): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', 'myescala1', 'CCkLDZ4O', Array)
#2 /usr/home/escala-18.com/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'myescala1', 'CCkLDZ4O', Array)
#3 /usr/home/escala-18.com/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(942): Doctrine\DBAL\Connection->connect()
#4 /usr/home/escala-18.com/web/src/PrestaShopBundle/Kernel/ModuleRepository.php(70): Doctrine\DBAL\Conn in /usr/home/escala-18.com/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 115

It can happen more than once per second so my guess is that somewhere in the code databases are getting opened and never closing, I intend to contact our host and see if we can get the max amount of connections increased.

In any case if you have any idea on what the issue would be regarding this matter I’d be thankful for any insight. Again, if this is better asked in a separate ticket just let me know.

Hoping you have a great day.

Fred 07 Feb 2023, 20:37

Hi, Unai G. Ansotegui - Ruben S. Alvarez Sociedad Civil.
Try to configure your mysql according to the prestashop documentation https://devdocs.prestashop-project.org/1.7/scale/optimizations/