Jump to content

[1.7.8.5] Backoffice very slow - Notification and AdminStat


Myo

Recommended Posts

Hello everyone.

After several days of unsuccessful research, I have come to ask you for help.

For several weeks, I have huge slowdowns in my backoffice, on almost all pages. I have to wait for all ajax requests to complete before I can do anything.

I'm pretty sure the problem is with the notification system when there's a new order/customer/message but I haven't been able to verify that.

I also think stats also slow down pages. I attach my log when launching the Catalog > Category page :

2023-07-2815_53_50-CatgoriesThibautNature.thumb.png.7a41698dd0ae3a5b28a947a2934fd920.png

This is all I tried to disable the notifications:

  • Advanced Settings > Administration: Notification, all disabled
  • Disable the "Order Notifications on the Favicon" module
  • Empty the ps_connections, ps_connections_page, ps_connections_source tables
  • In classes/Notification.php, I forced the function getLastElements() returned an empty array
  • Cache cleared

All these changes have not changed anything, the requests are still all sent.

Unfortunately I can't activate profile mode on my shop, all pages crash when I activate it.

Does anyone know how to disable these notification requests?
Same remark concerning the AdminStat requests which are launched on the pages which have a header with statistics, for example the list of customers which displays the average age of the customers. I don't want to disable my store stats, just turn off sending the request directly in the code if need be.

Thank you.

Edited by Myo (see edit history)
Link to comment
Share on other sites

I have 2 prestashop on the same server, the other is in a lower version, it contains more customers, more orders and more products. Both have the same modules but all the pages of the BO of the first site load in 1 second while the 2nd load in 5-8 seconds. I'm pretty sure the problem isn't with the host.

Link to comment
Share on other sites

Cleared cache, I also cleared the contents of /var/cache/

What are you looking for in F12? the call comes from main.bundle.js but I just can't find the source.

I'm on 1.7.8.5

Where can I go to disable the prestashop default call?

Link to comment
Share on other sites

2 hours ago, Myo said:

@musicmaster Be my hero please :)

I don't think those calls will take up so much time. It would be a better idea to enable _PS_DEBUG_PROFILING in /config/defines.inc.php and look whether some queries take too much time.

But if you want to play with those notifications: the only thing that I could find that main.bundle.js is included in /classes/controller/admincontroller.php. The relevant part looks like:

    public function setMedia($isNewTheme = false)
    {
        if ($isNewTheme) {
            $this->addCSS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/new-theme/public/theme.css', 'all', 1);
            $this->addJS(__PS_BASE_URI__ . $this->admin_webpath . '/themes/new-theme/public/main.bundle.js');

            // the multistore dropdown should be called only once, and only if multistore is used
            if ($this->container->get('prestashop.adapter.multistore_feature')->isUsed()) {
                $this->addJs(__PS_BASE_URI__ . $this->admin_webpath . '/themes/new-theme/public/multistore_dropdown.bundle.js');
            }
            $this->addJqueryPlugin(['chosen', 'fancybox']);
        } else {

But I have no idea what $isNewTheme is for...

 

Link to comment
Share on other sites

Quote

It would be a better idea to enable _PS_DEBUG_PROFILING in /config/defines.inc.php and look whether some queries take too much time.

I can't :(

Quote

Unfortunately I can't activate profile mode on my shop, all pages crash when I activate it.

2023-08-0915_56_47-Window.thumb.png.526c8cc999e42e3ca0d7f6c784769d27.png

 

2023-08-0915_58_16-Window.thumb.png.1128031e0594f4450abfdd5d206178a0.png

Link to comment
Share on other sites

On 7/28/2023 at 4:23 PM, Myo said:

Unfortunately I can't activate profile mode on my shop, all pages crash when I activate it.

I have never seen an error message like this before. I would like to see what is on that line 2013 but I have no idea how that could be achieved. I hope someone else can advise on that.

 - Obviously something more serious is wrong with your shop. But I have no idea what. Did you have a look at the server's error log?

 - Did you try to solve your speed problem by outcommenting the line with "main.bundle.js" in the code I mentioned?

 - Try to disable statistics modules

 

Link to comment
Share on other sites

Quote

But if you want to play with those notifications: the only thing that I could find that main.bundle.js is included in /classes/controller/admincontroller.php. The relevant part looks like:

I disabled the import of the bundle and the notifications are no longer called. Unfortunately, my BO is still slow, but I'm glad I can dismiss that point, thanks for the advice.

I managed to display the profiling but only from the Dashboard page. I'm not sure where to look to identify the problem, do you see something suspicious?

2023-08-1118_34_43-Window.thumb.png.3e9ec8624758e93267be12ff428de3c0.png

2023-08-1118_35_05-Window.thumb.png.2d56196300b4f77f863ffa3e7d29b4cc.png

2023-08-1118_35_51-Window.thumb.png.7115b5efa48dc67df4b434850620b957.png

2023-08-1118_36_41-Window.thumb.png.3bdf00de7740b3a6ff06d7b840e3029a.png

2023-08-1118_36_53-Window.png.be52123b3ab4c6ef024c2e0f27154c6f.png

2023-08-1118_37_19-Window.thumb.png.fd3bdd1638f1abe70a2cea7a6b495516.png

Link to comment
Share on other sites

I managed to disable all AdminStat calls and saved 2 seconds of loading on the affected pages, but I realize that the longest loading time is on the server side.

The only page where I managed to display the profiling is the fastest on the site, it is unfortunately not representative :(

I also tried disabling all languages but no change. 

Link to comment
Share on other sites

  • 1 month later...

Who initiate the calls to common/notifications is the getPush() function in ..../js/admin/notifications.js (on a 1.7.8.8)

In development I've commented the 

setTimeout(getPush, 120000);

line, not for performance, but because if I have "some" browser tabs opened in admin pages, debugging with symfony profiler become difficult, as it will be filled with the notifications requests.

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...