Jump to content

PS 1.7.7.3 slow backoffice (initHeader)


wzzly

Recommended Posts

Hi all,

we are trying to improve BO speed, because loading every page in the backoffice takes more than 3 seconds.

When I enable profiler, I see that it is caused by config and initheader:

 				Time	Cumulated Time	Memory Usage Memory Peak Usage
config			1631 ms		1631 ms		26.62 Mb	33.98 Mb
__construct		0 ms		1631 ms		- Mb		33.98 Mb
init			87 ms		1718 ms		1.75 Mb		33.98 Mb
checkAccess		0 ms		1718 ms		- Mb		33.98 Mb
setMedia		20 ms		1738 ms		0.21 Mb		33.98 Mb
postProcess		0 ms		1738 ms		- Mb		33.98 Mb
initHeader		1847 ms		3585 ms		1.75 Mb		33.98 Mb
initContent		0 ms		3586 ms		- Mb		33.98 Mb
initFooter		1 ms		3586 ms		0.01 Mb		33.98 Mb
display			43 ms		3629 ms		0.27 Mb		33.98 Mb

Config is faster when no visiting the orders page, but initHeader is slow on every BO page.

I already tried deleting all third party modules on a staging site, but the problem remains. Also unhook all modules from hooks like DisplayBackOfficeHeader or DisplayBackOfficeTop does not help...

Any idea why this is only on the BO? The frontoffice is fine and initheader is even it 0ms on FO.

Link to comment
Share on other sites

This is the line (897) from the /classes/Link.php

 

            //Use the matching shop if present, or fallback on the default one
            if (null !== $idShop) {
                $shop = new Shop($idShop);
            } else {
                $shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
            }
 

is it not able to find the shop ID or something?

Link to comment
Share on other sites

5 hours ago, wzzly said:

This is the line (897) from the /classes/Link.php

 

            //Use the matching shop if present, or fallback on the default one
            if (null !== $idShop) {
                $shop = new Shop($idShop);
            } else {
                $shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
            }
 

is it not able to find the shop ID or something?

138 times is a lot. It suggests that you have a multishop and that it is set for all shops. Prestasshop isn't handling the situation very nice. So you might consider opening an issue on their Github.

For the rest I suggest that you install on the same server a fresh installation of the same Prestashop version. Then you can compare and see whether your values are really unusual for your situation.

Link to comment
Share on other sites

@musicmaster I did and there they say it's normal as there are probably 138 links in the BO (menu) that need to be loaded.

Anybody have any idea what is being called by initHeader on the BO? This takes up the most loading time. I already tried unhooking as much as possible from displayAdminHeader

Link to comment
Share on other sites

  • 2 weeks later...
2 hours ago, wzzly said:

@musicmaster you have any more ideas I could check?

On GTmetrix it also says is has long TTFB

GT Metrix is rather critical. If you have a cheap hosting provider you are unlikely to win  a prize with them.

Did you pay attention to the place from where they measured your site? If it is at the other side of the Atlantic that would explain a lot.

Did you also try GTMetrix's competitors such as Google Page Speed, Yahoo Yslow and Pingdom?

As the queries aren't the problem on your site it must be the loading of the files. Check that in the Network tab of the browser console.

Link to comment
Share on other sites

8 minutes ago, wzzly said:

@musicmaster

Yes did it on different competitors aswell.

In the BO I also notice that when visiting the orders page, the loading of config takes up alot of memory and time. What does that mean?

 

I have no idea.

My suggestion was to look at Network in the Browser console. Did you do that?

Link to comment
Share on other sites

@musicmaster maybe I found something?

When I look in DevTools on the BO order page, I see this error in my console.
And when I check the Network tab, I see that this file: bootstrap-sortable.js is the first thing called.... is that coincidence?

image.thumb.png.473461281d895a27fba0d4e4ce9432af.png

 

Link to comment
Share on other sites

I don't know how to solve this.

Some final suggestions:

 - have a look at the Waterfall in GTMetrix

 - what puzzles me with the bootstrap-sortable.js the most is that it comes from an external site. Is that some module you installed?

 - jQuery errors are unfortunately quite common. In this case one has too wonder whether jquery just isn't loaded yet.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...