Fatal error: Uncaught exception 'Exception' with message 'Error: User '173672_menu' has exceeded the 'max_questions' resource (current value: 50000)<br />Error No: 1226<br />SELECT * FROM oc_extension WHERE `type` = 'openbay'' in /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/system/library/db/mysqli.php:40 Stack trace: #0 /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/system/library/db.php(16): DB\MySQLi->query('SELECT * FROM o...', Array) #1 /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/system/library/openbay.php(117): DB->query('SELECT * FROM o...') #2 /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/system/library/openbay.php(10): Openbay->getInstalled() #3 /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/vqmod/vqcache/vq2-system_storage_modification_system_engine_loader.php(110): Openbay->__construct(Object(Registry)) #4 /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/system/framework.php(81): Loader->library('openbay') #5 /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/vqmod/vqcache/vq2 in /srv/disk7/173672/www/menu.moonlite-solutions.co.uk/system/library/db/mysqli.php on line 40
I have tested a few times, and it doesnt really matter which extension it fails on, or anything database call for that matter, its all random, the only thing that isnt is adding products to the cart before this error occurs.
I understand my shared hosting wont increase the limit however, surely adding 20 odd products should not cause this error?
If it is any help, im also running multistores.
Otherwise no one could know the cause. Maybe a ddos even (a bot perhaps or more malicous). 50k questions per hour?
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
It could be an extension which is for some reason causing a database query loop, however, i see no error in log file.
Because this only happens while adding products to the cart i am at a loss as to what would cause it, from what i understand, there are no database queries during this process as nothing is added to the database until you proceed to checkout? isnt adding items to the cart prior to checkout just handled by JSON event?
I would ask my host to confirm what is exactly querying the database to many times but i cant see id get a response since i dont believe anything would be.
See screenshot for adding to mysqli.php in system>library>db
Code: Select all
//$log = new \Log('db'.date('Y-m-d').'.log');
//$log->write($sql);
JSON event or AjAX does contact the server but there's no page refresh needed.
Attachments
Screenshot_2017-07-31-08-10-55.jpg (340.54 KiB) Viewed 6717 times
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
After adding 34 products to the cart and clicking checkout the site crashed, i checked the error log for information.
Bare in mind this is everything that got queried just on that page alone, i typed the exact url location of the page in to the browser before running the log file script, so it doesnt include any other queries for the rest of the site.
Adding 34 products, and clicking checkout resulted in over 50000 SELECT queries alone.
I get that one customer may not add 34 products in one session, but what if 10 people add 3? will this not still cause max questions to go over 50000 within an hour?
And don't forget to disable the logging!!!
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
However, oc kinda does the same thing. Guess it would only be an issue with limited web hosting but still has room for improvement.
You could also start using a page cache like the free budgetneon's one which is in the extension market. This prevents calling the db for static content.
Hope it helps,
Cheers
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
Unfortunately the site requires a menu style category product layout and so it uses a category product module to display all products on one page hence why you see multiple dB queries. There may be a better way to optimise it but I would need to contact the developer.
Either way I think perhaps a page cache may be the way forward.
Thanks for the help.
I can not help but feel this change has dramatically increased database queries and have limited the amount of people that can use it on shared hosting.
The fact I need multistore adds to the issue.
It probably loops through everything to check for stock and others like specials, discounts and so on for every add to cart action. I can imagine doing this for 14 products would quickly exhaust the 50k limit you have. Unfortunately you can't cache the dynamic content like carts.
Either find a better host or see how the competition handles this. I'm suspecting not much of a difference for other webshop solutions. I agree it seems a bit too much...
Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+
Thanks!
- Can a query for each product be consolidated into one query for all the products? At some point it may be cheaper to get a big chunk of data and trim it down in PHP to get to the relevant data. I hope OC isn't making multiple queries for each item in the cart.
- Has anyone looked into some sort of DB caching? That is, hold on to the queried data in-memory, rather than constantly going back to the DB to refresh it. Obviously, for something like product stock level, a query would have to be done during checkout to ensure that stock isn't overdrawn, but it would be only a small inconvenience compared to constantly checking. How likely is the product price to change while someone is shopping? Maybe there could be a flag indicating table updates and the need to refresh the cache.
Ideally I'd like to store the cart contents in a cache and just simply send it to the order table on completion bypassing all the cart table queries.
I built a similar site years ago using 1.5.6 and I must say I never had this trouble. So I can only assume it relates to the change that was made with handling cart contents from session based to database.
I've even gone to the lengths of converting ocmods back to vqmods to reduce the number of queries.
I also notice oc runs the same queries over and over. Extensions and openbay for example. All not needed. They should be checked once and stored somewhere until a change is made. It could all be triggered simply by clearing the cache. I must say I'm disappointed with the way oc has changed and can not understand the reason behind it. Maybe I've missed something.
ProductsGenerator Extension, and those 50 products generated
a 2182 line Log by use of my Version 1.5.6.5, just to mention this!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I'm curious. Where can I get a copy of your version? I'm seriously considering reverting back.
but to make sure, it would be advisable, to have it installed by me, since I
am not yet ready to offer it as ready-to-go installation.
Check the 3 Links on my Comment-Footer, to find the 3 differently themed
Versions.
Ernie
PS: But only, if you promise, not to SELL it afterwards, it's not planned to be
sold, in the first Place, despite of the fact, that it works better than anything,
i have tested, before and after it, so far...
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Users browsing this forum: No registered users and 53 guests