Jump to content

Very slow backend


mitzayapa

Recommended Posts

Exactly the same problem on several 1.6 sites

It's due to very long time to get response fromapi.addons.prestashop.com

I've temporarily disabled connection to this api in classes/Tools.php

    public static function addonsRequest($request, $params = array())                                                                                                                                             
    {
        return false; 

 

  • Like 2
  • Thanks 5
Link to comment
Share on other sites

Indeed we have seen the same. Examining the page load from a stack trace it seems that the slowness is coming from the handshake with api and profile prestashop.com  

 

There is a bigger wait time when the prestashop IP's are connecting and responding.  

 

connect(10, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("91.240.109.18")}, 16) = -1 EINPROGRESS (Operation now in progress) poll([{fd=10, events=POLLIN|POLLOUT|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=10, revents=POLLOUT}]) getsockopt(10, SOL_SOCKET, SO_ERROR, [0], [4]) = 0

fcntl(10, F_SETFL, O_RDWR)              = 0

sendto(10, "POST / HTTP/1.0\r\nHost: api.addon"..., 268, MSG_DONTWAIT, NULL, 0) = 268 poll([{fd=10, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout) poll([{fd=10, events=POLLIN|POLLERR|POLLHUP}], 1, 5000

Link to comment
Share on other sites

 

What part of the code should be deleted or modified?

 

public static function addonsRequest($request, $params = array())
    {
        if (!self::$is_addons_up) {
            return false;
        }

Link to comment
Share on other sites

This is for Prestashop 1.7

 

Change

 

    public static function addonsRequest($request, $params = array())
    {
        if (!self::$is_addons_up) {
            return false;
        }

 

To

    public static function addonsRequest($request, $params = array())
    {
            return false;

 

 

 

 

4 minutes ago, lorena said:

 

What part of the code should be deleted or modified?

 

public static function addonsRequest($request, $params = array())
    {
        if (!self::$is_addons_up) {
            return false;
        }

  • Thanks 3
Link to comment
Share on other sites

3 hours ago, Befox said:

Exactly the same problem on several 1.6 sites

It's due to very long time to get response fromapi.addons.prestashop.com

I've temporarily disabled connection to this api in classes/Tools.php


    public static function addonsRequest($request, $params = array())                                                                                                                                             
    {
        return false; 

 

Thanks for solution! works for 1.6 version

Link to comment
Share on other sites

mikecc444 You have changed the wrong bit of code by the looks of it

In classes/Tools.php

Change

 

    public static function addonsRequest($request, $params = array())
    {
        if (!self::$is_addons_up) {
            return false;
        }

 

To

    public static function addonsRequest($request, $params = array())
    {
            return false;

Link to comment
Share on other sites

2 minutes ago, pdkey said:

thanks - PS. 1.7.2 - it works. 

what a bad joke of presta. Even the front runs just under 1 second faster.

 

That's exactly what we have noticed. The customer frontend was also stalling until we made the change and now, as you say pdkey, we are seeing pages loading extremely fast, probably twice as fast now.

More worrying, this has been going on over 24 hours and nothing has been mentioned, as far as I can see, by Prestashop that they are having issues with the addons subdomain. I really don't think 1 line of code should have impact across an entire webshop and makes me think what other "loose" bits of badly thought out code sit beneath the platform.

Link to comment
Share on other sites

Problem is that addonrequest overrided by this module is used on the module list and for the updates. What about overriding the admincontrollerclass....:  filterTabModuleList and initTabModuleList, only used for the puzzle button on the top of every admin pages.

  • Like 1
Link to comment
Share on other sites

39 minutes ago, jajalfplv said:

Problem is that addonrequest overrided by this module is used on the module list and for the updates. What about overriding the admincontrollerclass....:  filterTabModuleList and initTabModuleList, only used for the puzzle button on the top of every admin pages.

 

thanks for feedback, we need to re-institute our github so developers can add to code base....to be honest we probably will not dev this further....if you  would like to improve and  post back here that would be great.  (also I'm always  interested in new talent to join team, i.e. developer)  and I like it when someone  has a better idea...

Link to comment
Share on other sites

I tried this today and it works great: 

// @file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));

// $this->refresh(Module::CACHE_FILE_TAB_MODULES_LIST, _PS_TAB_MODULE_LIST_URL_);

//file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));

//file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_ALL_COUNTRY_MODULES_LIST, Tools::addonsRequest('native_all'));

//@file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));

 

 

Everything is ok on the modules page, and backoffice runs faster as ever

  • Like 1
Link to comment
Share on other sites

16 hours ago, jajalfplv said:

I tried this today and it works great: 

// @file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));

// $this->refresh(Module::CACHE_FILE_TAB_MODULES_LIST, _PS_TAB_MODULE_LIST_URL_);

//file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));

//file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_ALL_COUNTRY_MODULES_LIST, Tools::addonsRequest('native_all'));

//@file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'));

Please explane. Where to put this code
Thanks

Link to comment
Share on other sites

On 1/10/2018 at 12:26 PM, kacifashionuk said:

This is for Prestashop 1.7

 

Change

 

    public static function addonsRequest($request, $params = array())
    {
        if (!self::$is_addons_up) {
            return false;
        }

 

To

    public static function addonsRequest($request, $params = array())
    {
            return false;

 

 

 

 

Works fine in my PS 1.6.1.20 !

But Does anyone know if it is convenient to restore it after a while?

Link to comment
Share on other sites

My XML file got corrupted and could not login to backend anymore.

renamed the file /config/xml/must_have_modules_list.xml and I could login to backend once again.

What a  stupid mistake with high impact for the prestashop community!!!!!
 

 

Link to comment
Share on other sites

I've just changed the name of the gamificaton module by adding a few xxx at the end (gamification-xxx) and now backoffice is super speedy.

Do I need Merchant Experience module? No, I don't.  And, as it seems the problem is coming from the Prestashop servers, I can later try by just renaming the module directory to it's original name and see if the problem is solved. 

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
On 15.10.2018 at 4:55 AM, harun272 said:

I've just changed the name of the gamificaton module by adding a few xxx at the end (gamification-xxx) and now backoffice is super speedy.

Do I need Merchant Experience module? No, I don't.  And, as it seems the problem is coming from the Prestashop servers, I can later try by just renaming the module directory to it's original name and see if the problem is solved. 

Wow, this was the solution! Exactly, now my backend is fast as hell. Thank you so much!!

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

My verson 1.7, I was having the same issues, VERY slow BO... after searching, I did this.....

I removed/uninstalled all modules that I was NOT using, INCLUDING  the dashboard modules.

I didn't mess with any code or file.......just uninstall what I dont use......

My BO now is fast, the same as any web page I bring up now.......if it dont work for you

you can always reinstall them.

  • Like 1
Link to comment
Share on other sites

12 hours ago, DEN99 said:

My verson 1.7, I was having the same issues, VERY slow BO... after searching, I did this.....

I removed/uninstalled all modules that I was NOT using, INCLUDING  the dashboard modules.

I didn't mess with any code or file.......just uninstall what I dont use......

My BO now is fast, the same as any web page I bring up now.......if it dont work for you

you can always reinstall them.

 

 

I would never deinstall Dashboard Modules. These are the heart of a Shop. Thats a very very bad idea but however. The only thing you need to deinstall is gamification and all is done. That's what i did and its lightning fast with all dashboard modules intact.

Link to comment
Share on other sites

  • 1 month later...
On 10/10/2018 at 8:25 AM, Daresh said:

It may not be enough, it's better to disconnect from Addons, my solution here: http://greenmousestudio.com/en/back-office

Hi, thanks for the tip. Maybe a stupid question but is it also safe to follow these steps when some modules were ordered through addons shop at Prestashop? I remember we had to enter the shop URL at the time of ordering modules. Does it need this external connection to check if modules are genuine? The use of ordered modules won't be affected over time? Thank you.

EDIT: Gamification and Cron Tasks Manager module were already uninstalled. Creating Tools.php file did the trick for me.

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

  • 3 weeks later...
On 10/15/2018 at 5:55 AM, harun272 said:

I've just changed the name of the gamificaton module by adding a few xxx at the end (gamification-xxx) and now backoffice is super speedy.

Do I need Merchant Experience module? No, I don't.  And, as it seems the problem is coming from the Prestashop servers, I can later try by just renaming the module directory to it's original name and see if the problem is solved. 

WOW!!! I made the same, super fast, thank you very much

Link to comment
Share on other sites

On 10/1/2018 at 12:55 PM, Befox said:

Exactly the same problem on several 1.6 sites

It's due to very long time to get response fromapi.addons.prestashop.com

I've temporarily disabled connection to this api in classes/Tools.php


    public static function addonsRequest($request, $params = array())                                                                                                                                             
    {
        return false; 

 

I got 500 internal error

Link to comment
Share on other sites

  • 2 weeks later...
On 2/15/2019 at 10:34 PM, Tomin said:

On 1.7.4.4 few weeks ago only in one installation somehow Currency block made BO incredibly slow. I just disabled it without looking further, as I don't need it.

How were u able to find it was this module to make BO incredibly slow? I unistalled it as well but it's keep being super slow the BO 😕

Link to comment
Share on other sites

11 hours ago, legioxroma said:

Unfortunately it didnt help 😕

try uninstalling merchant expertise module....see if that helps

on performance page for test only,  disable 3rd party modules  and overrides, restest...if not slow then it's a module

hope that helps

Link to comment
Share on other sites

  • 2 months later...

I found that jirafe.com was down, which made the backend slow. The jirafe (Analytics for ecommerce) module fetches css and js from the domain. Changed this in modules/jirafe/jirafe15.php:

 

public function hookBackOfficeHeader($params)
    {
        return '
            <link type="text/css" rel="stylesheet" href="https://jirafe.com/dashboard/css/prestashop_ui.css" media="all" />
            <script type="text/javascript" src="https://jirafe.com/dashboard/js/prestashop_ui.js"></script>';
    }

to 

public function hookBackOfficeHeader($params)
    {
        return '';
        return '
            <link type="text/css" rel="stylesheet" href="https://jirafe.com/dashboard/css/prestashop_ui.css" media="all" />
            <script type="text/javascript" src="https://jirafe.com/dashboard/js/prestashop_ui.js"></script>';
    }

When the site is up again, you can revert your change.

Link to comment
Share on other sites

15 hours ago, Patrik Lindblom said:

I found that jirafe.com was down, which made the backend slow. The jirafe (Analytics for ecommerce) module fetches css and js from the domain. Changed this in modules/jirafe/jirafe15.php:

 


public function hookBackOfficeHeader($params)
    {
        return '
            <link type="text/css" rel="stylesheet" href="https://jirafe.com/dashboard/css/prestashop_ui.css" media="all" />
            <script type="text/javascript" src="https://jirafe.com/dashboard/js/prestashop_ui.js"></script>';
    }

to 


public function hookBackOfficeHeader($params)
    {
        return '';
        return '
            <link type="text/css" rel="stylesheet" href="https://jirafe.com/dashboard/css/prestashop_ui.css" media="all" />
            <script type="text/javascript" src="https://jirafe.com/dashboard/js/prestashop_ui.js"></script>';
    }

When the site is up again, you can revert your change.

you could just load that locally and never worry if it's available, cheers el

Link to comment
Share on other sites

8 hours ago, giwrgos88 said:

do you have them local to share it with us?

 

Hi, you would need to get copy of files from jirafe, or via 'vew page source after css/js fetched.  Then you would load css/js via PS calls in module as compared to remote call.  So it takes a bit of tech work to do.  

maybe open a new topic, how to call remote js/css into internal call.  

Link to comment
Share on other sites

2 hours ago, El Patron said:

 

Hi, you would need to get copy of files from jirafe, or via 'vew page source after css/js fetched.  Then you would load css/js via PS calls in module as compared to remote call.  So it takes a bit of tech work to do.  

maybe open a new topic, how to call remote js/css into internal call.  

there website is down, how i will load them or visit their page to get them? 

if anyone has them please share it with me and i will create a new topic how to fix the issue

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

14 hours ago, El Patron said:

I checked and jirafe has 'gone out of business'.  closed

you will want to uninstall the jirafe module, that will solve the issue.

true, i think is the best option. do we know exactly where this module it is used in the admin panel? which parts affect, if it affects

Link to comment
Share on other sites

On 10/1/2018 at 1:26 PM, kacifashionuk said:

This is for Prestashop 1.7

 

Change

 

    public static function addonsRequest($request, $params = array())
    {
        if (!self::$is_addons_up) {
            return false;
        }

 

To

    public static function addonsRequest($request, $params = array())
    {
            return false;

 

Hi,

PrestaShop version 1.6.1.23

OS: Win 10

Browser: Firefox (main one used to work), Chrome, Waterfox

 

I tried the above code and i don't see much improvement to my error. The main problem is regarding to save and stay and save buttons that are loading for at least 10-15 seconds before they can be pressed again. It is very annoying.

I have a thread opened here:

Prestashop Back Office - Loading forever Product page - Information Save and Stay + Save buttons and Not saving updates to existing products (text + photos) - 1.6.1.x [Current] - PrestaShop Forums

where i describe my issue with prestashop going slow.
 

I hoped that this solution will help, but until now i didn't see any improvement.

I also deleted the browser cache, i cleaned up cache from prestashop (/cache/smarty -> from the 2 folders) but is not an improvement from before unfortunately.

 

 

Any other ideas?

 

Thank you,

Link to comment
Share on other sites

  • 4 months later...
On 2/22/2019 at 4:12 AM, El Patron said:

try this module to see if it helps slow back office..

 

https://www.prestaheroes.com/en-us/performance-emergency-fix-disable-api-connection-to-prestashop-addons

 

happy selling, el

.

 

On 2/22/2019 at 4:12 AM, El Patron said:

try this module to see if it helps slow back office..

 

https://www.prestaheroes.com/en-us/performance-emergency-fix-disable-api-connection-to-prestashop-addons

 

happy selling, el

Hi El,

I just purchased your module to disable addons api call to prestashop.

I expect this module to be able to completely disconnect our website to prestashop such as not showing any modules & services recommendations in Modules Catalog.

But surprisingly, your module just doing things that is freely informed in forum such as some of this links below :
- https://www.prestashop.com/forums/topic/907905-very-slow-backend/?do=findComment&comment=2979298
this is before you posted the link to purchase your module which basically does the same as comment above

- http://nemops.com/faster-prestashop-back-office-modules-themes-ads/#.XYSl9uczZE7

The reason I purchased your module is because I've tried to "return false;" in "function addonsRequest", but it's not working in PS 1.7

In Module Catalog it stil loading "150+ Modules and services selected for you".

So can you tell me if this module can work more than that and completely remove modules recommendation as described above? Because if it's not, It would be nice if you can refund as this module is really not working to disable prestashop 1.7 addon API at all.

Looking forward to hearing from you.

 

updated :

Attached in screenshot is what appear in Modules > Catalog
That it's still contacting to Prestashop's Addons and showing something like :
"151 modules and services selected for you"

So, basically your "simple module solution that does not harm" is not as mentioned in your description :
"Fixes performance impact of back end automatically calling PrestaShop addon’s."
Because it's still calling Prestashop addon's. And loading time to show all those 151 modules is taking more than 10sec

So what's your solution for this?
 

prestaheroes-el-patron-disableaddonsapi-not-working.jpg

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

  • 1 month later...

Hello,

I created this file override/classes/Tools.php and put this content in it :

<?php
class Tools extends ToolsCore
{
    public static function addonsRequest($request, $params = array())
    {
        return false;
    }
}

It seems to be working great. I'm in Prestashop 1.6.1.17. 

Can someone tell me if it's ok or if it can lead to problems ?

Thanks a lot.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

Hello again,

After a few weeks of improvement with orders page load (due to the above override), I'm back with 20 second page load...

Any idea why ?

Connection to external API seems to be off so why does it take so long (23.44 sec) ?

I had a look inside google inspector and here's what I got (I ordered by page load desc):

image.thumb.png.e153a3920f65a706aa84f6f365d19b33.png

What do you think I should do ?

 

Thanks for your help.

Link to comment
Share on other sites

  • 5 weeks later...

I emptied my database and it went from 2,61 G to 302 M. 

However, when I click on the orders list tab, it takes more than 20 seconds to display the page.

Console displays that the TTFB is 25,16 seconds. 

Any idea how can I know why it takes so long ?

 

Link to comment
Share on other sites

Hi @bonsaiko did you find any solution? I also noticed back offlice 'lag' - around 15 seconds delay for loading on network side, but I cannot figure out what is the cause of that. What I tried:

 

- Disabling/uinstalling meachant expert/renaming gamification directory

-cleaning up the database a little bit from all the statistics data, etc,

- editing classes/Tools.php to 'return false' for fuctnion addonsRequest.

- removing "xml" files from /config/xml

but it seems those actions had no effect on the performance.

Front office works fine.

 

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

Well i had exatly same problem, 1min to load orders in bo, nothing seems to helped then i went for upgrade to thirtybees and my problem was solved. Now whole BO seems faster, order page under 2 min... But this might not solve your problem. I woud made copy of yr shop and if u are desparate enough u can try it.

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

  • 3 weeks later...
  • 2 months later...

Hi
I have a problem with very slow BO
Prestashop 1.7.2
I have made the changes you are writing above, but it looks like the problem is elsewhere.

I have a server on OVH and my TTFB for BO is 1.0 min !!!
For FRONT it is not so bad because 444.59 ms
Apparently, OVH blocks connections to license servers.
Does anyone have a similar problem?

Link to comment
Share on other sites

  • 4 weeks later...
On 6/2/2020 at 1:29 PM, charter said:

Hi
I have a problem with very slow BO
Prestashop 1.7.2
I have made the changes you are writing above, but it looks like the problem is elsewhere.

I have a server on OVH and my TTFB for BO is 1.0 min !!!
For FRONT it is not so bad because 444.59 ms
Apparently, OVH blocks connections to license servers.
Does anyone have a similar problem?

same problem. server support told me:
"On checking the slow php logs, I am seeing some php scripts which could be related to this:
[0x00007f803b414e70] getConfiguration()  /modules/welcome/OnBoarding/OnBoarding.php:141
[0x00007f803b414d80] loadConfiguration()  /modules/welcome/OnBoarding/OnBoarding.php:57
[0x00007f803b414cd0] __construct()  /modules/welcome/welcome.php:75
[0x00007f803b414c40] __construct()  /src/Core/Foundation/IoC/Container.php:127
[0x00007f803b414be0] newInstance()  /src/Core/Foundation/IoC/Container.php:127
[0x00007f803b414ad0] makeInstanceFromClassName()  /src/Core/Foundation/IoC/Container.php:160
[0x00007f803b414a00] doMake()  /src/Core/Foundation/IoC/Container.php:173
[0x00007f803b414980] make()  /src/Adapter/ServiceLocator.php:60
[0x00007f803b4148f0] get()  /classes/module/Module.php:1091
[0x00007f803b414830] coreLoadModule()  /classes/module/Module.php:1071
"

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

  • 9 months later...

In PrestaShop 1.6 version, there is a slow backend response occurred but in upgradation of PrestaShop 1.6 to 1.7 version so many changes are added in back office (order page),front office and shows all recommended modules in Backoffice.

Here I am attaching link from this link you can see all changes and download new version of PrestaShop.

Know More https://build.prestashop.com/news/prestashop-1-7-7-0-available/#:~:text=More%20than%20160%20bugs%20have,brings%20support%20for%20PHP%207.3!

Link to comment
Share on other sites

  • 1 month later...

We also have a really slow BO on 1.7.7.3 . 

Seems like the TTFB is always 5+ seconds, which is really bad when doing daily tasks.
It's not the hosting as the TTFB is only there with prestashop, not with other wordpress sites.

Link to comment
Share on other sites

1 hour ago, wzzly said:

Seems like the TTFB is always 5+ seconds, which is really bad when doing daily tasks.
It's not the hosting as the TTFB is only there with prestashop, not with other wordpress sites.

how large is your Database?

Link to comment
Share on other sites