Syns Posted December 14, 2016 Share Posted December 14, 2016 Hi, I'm using Prestashop 1.6.0.14, it's been two days my website suddenly experienced lot of timeout error especially after clicking "Add to cart" it takes more than 20 seconds to show Ajax cart pop up. my hosting provider said that there were so many queries for a shopping cart request and also the POST request after clicking the "Add to Cart" is not returned immediately. here are what I've done: - Optimized database (clearing abandoned cart, connection information, guest) - turned off Ajax cart - disabled google analytic module - disabled statistic on Cpanel - changing cache folder and its sub folders permissions to 777 - disabled my custom checkout page - cleared cache (Prestashop & browser) - turning on debug mode but I didn't see anything - restarted web service (Apache & SQL) so any idea what might causing it? any help much appreciated. Thank you Link to comment Share on other sites More sharing options...
Rolige Posted December 14, 2016 Share Posted December 14, 2016 Have you installed some carrier module? Link to comment Share on other sites More sharing options...
Syns Posted December 14, 2016 Author Share Posted December 14, 2016 Have you installed some carrier module? No, I haven't added any new carrier. Link to comment Share on other sites More sharing options...
Rolige Posted December 14, 2016 Share Posted December 14, 2016 I understand, try disabling the ajax cart and turn on the _PS_DEBUG_PROFILING_ on the /config/defines.inc.php, this will show stats of performance, this could help you to find the problem source. Link to comment Share on other sites More sharing options...
Syns Posted December 14, 2016 Author Share Posted December 14, 2016 I understand, try disabling the ajax cart and turn on the _PS_DEBUG_PROFILING_ on the /config/defines.inc.php, this will show stats of performance, this could help you to find the problem source. done, here's what it shows after I click "add to cart": "Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes) in /home/klik/public_html/tools/profiling/Db.php on line 110" it's on checkout page Link to comment Share on other sites More sharing options...
Syns Posted December 15, 2016 Author Share Posted December 15, 2016 Bump this topic. I finally found what causing this issue, it caused by vouchers lot of it. I created around 10k vouchers (not stacked but unique ID for each voucher) that caused a long page load sometimes operation timeout error showed up when clicking Add to cart button, when I erased all the vouchers my website returns to normal. So is there any way to tweak this thing? I really need these vouchers but I don't want it to caused such a heavy load on my site. Thanks Link to comment Share on other sites More sharing options...
Jignesh.aakoliya Posted December 15, 2016 Share Posted December 15, 2016 Hi,In your php.ini make memory_limit=-1;That will solve your issue.Thanks. Link to comment Share on other sites More sharing options...
Syns Posted December 15, 2016 Author Share Posted December 15, 2016 Hi, In your php.ini make memory_limit=-1; That will solve your issue. Thanks. Hi, thanks for your advice, I just changed my memory_limit to -1 but it still takes approx. 30s to show up the ajax cart. Link to comment Share on other sites More sharing options...
Jignesh.aakoliya Posted December 15, 2016 Share Posted December 15, 2016 Hi, thanks for your advice, I just changed my memory_limit to -1 but it still takes approx. 30s to show up the ajax cart. I suggest to increase memory limit to avoid fatal error. there are so many voucher as you say thats why it is taking time to show up cart. Link to comment Share on other sites More sharing options...
Syns Posted December 16, 2016 Author Share Posted December 16, 2016 I suggest to increase memory limit to avoid fatal error. there are so many voucher as you say thats why it is taking time to show up cart. I've already set memory limit to -1 but it's no help, so I revert back to 1024M. I wonder why prestashop must process cart_rules query (voucher) when adding to cart, it supposes to be on checkout page right? Link to comment Share on other sites More sharing options...
Rolige Posted December 16, 2016 Share Posted December 16, 2016 The memory limit cannot be changed to unlimited on shared hostings, I really don't know why you need have around 10k cart rules, but definitely you should think about using fewer codes. Link to comment Share on other sites More sharing options...
Syns Posted December 16, 2016 Author Share Posted December 16, 2016 The memory limit cannot be changed to unlimited on shared hostings, I really don't know why you need have around 10k cart rules, but definitely you should think about using fewer codes. Yes, I'm aware that so I asked my hosting provider to changed that, and btw I'm using a business hosting not shared one. I need 10k cart rules for an event with my sponsor, they need 10k vouchers with unique ID each of them. so there's no way to fix this except remove the vouchers? Link to comment Share on other sites More sharing options...
Rolige Posted December 16, 2016 Share Posted December 16, 2016 I do not know, maybe could be optimized a little more the way how read the codes, or skip that part, but if your hosting provider can increase memory, maybe that solves the problem. Link to comment Share on other sites More sharing options...
[email protected] Posted March 23, 2019 Share Posted March 23, 2019 I know ist an old thread ... but maybe my solution helps someone who struggles with it ... check the file System rights. I used Linux command: chmod 777 -R * At the root folder of my shop and the issue was gone. To be clear, in my case it was an Testserver ... not productiv. Do not do this command on your live Server, because it can cause security issues Please checkout Prestashop documentation how the set the rights properly Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now