Post by twdre » Thu Oct 17, 2024 5:15 am

H im getting the following error when go to checkout page. At the moment there are almost 1000 products in the shopping basket

504 Gateway Time-out
The server didn't respond in time.

What can I do to solve this as it is a wholesale site which should be normal to have a lot of product in the basket

Opencart Version 3.0.3.8

Thanks for any directions or tips
Last edited by twdre on Mon Oct 21, 2024 9:02 pm, edited 1 time in total.

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by nonnedelectari » Thu Oct 17, 2024 6:45 am

Wholesale doesn't mean a lot of products, it means products in large quantities.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by twdre » Thu Oct 17, 2024 4:17 pm

Yes ok but we have also arround 100 k of products.
and of course wholesale prices and not retail prices

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by OSWorX » Thu Oct 17, 2024 5:12 pm

Guess you should adopt the severs value of max_input_vars
See: https://www.php.net/manual/en/info.conf ... input-vars
Normally this value has 1.000 per default, increase it to 4.000 and see what's happen ..

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by twdre » Thu Oct 17, 2024 5:34 pm

OSWorX wrote:
Thu Oct 17, 2024 5:12 pm
Guess you should adopt the severs value of max_input_vars
See: https://www.php.net/manual/en/info.conf ... input-vars
Normally this value has 1.000 per default, increase it to 4.000 and see what's happen ..
Thank you for your response.
I did put it already to 5000 . Saddly that also Is not helping

My hoster told me jus a few minutes ago its a timeout door HAProxy.

And now tells me to look if it is possible to let the shoppingcart go arround the database to solve the time out.
I thinks this will not be possible or... ??
As it is on a shared server they dont want to change anything to solve this (something to do with resources I think)

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by nonnedelectari » Thu Oct 17, 2024 5:48 pm

twdre wrote:
Thu Oct 17, 2024 5:34 pm
OSWorX wrote:
Thu Oct 17, 2024 5:12 pm
Guess you should adopt the severs value of max_input_vars
See: https://www.php.net/manual/en/info.conf ... input-vars
Normally this value has 1.000 per default, increase it to 4.000 and see what's happen ..
Thank you for your response.
I did put it already to 5000 . Saddly that also Is not helping

My hoster told me jus a few minutes ago its a timeout door HAProxy.

And now tells me to look if it is possible to let the shoppingcart go arround the database to solve the time out.
I thinks this will not be possible or... ??
As it is on a shared server they dont want to change anything to solve this (something to do with resources I think)
Did you optimize your database, index-wise?

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by JNeuhoff » Thu Oct 17, 2024 5:53 pm

I don't think any ecommerce software will support thousands of products in the basket or checkout. This is just a crazy number of items. The only realistic way of achieving such a crazy thing is by customizing your OpenCart for such a scenario, so you may have to find a professional developer on the commercial support section of this forum for this.

And of course, use a more dedicated webhosting plan, a simple shared hosting won't cut it.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by twdre » Thu Oct 17, 2024 6:04 pm

nonnedelectari wrote:
Thu Oct 17, 2024 5:48 pm
twdre wrote:
Thu Oct 17, 2024 5:34 pm
OSWorX wrote:
Thu Oct 17, 2024 5:12 pm
Guess you should adopt the severs value of max_input_vars
See: https://www.php.net/manual/en/info.conf ... input-vars
Normally this value has 1.000 per default, increase it to 4.000 and see what's happen ..
Thank you for your response.
I did put it already to 5000 . Saddly that also Is not helping

My hoster told me jus a few minutes ago its a timeout door HAProxy.

And now tells me to look if it is possible to let the shoppingcart go arround the database to solve the time out.
I thinks this will not be possible or... ??
As it is on a shared server they dont want to change anything to solve this (something to do with resources I think)
Did you optimize your database, index-wise?
Thank you
Im now looking to this post if this could be the sollution: viewtopic.php?t=227675&hilit=memcached+db

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by JNeuhoff » Thu Oct 17, 2024 7:04 pm

You still haven't explained why you need such a strange scenario in the first place. Do you really expect a customer to spend hours or days to add thousands of products into a shopping cart?

Besides, OpenCart already uses a DB table for the shopping cart, namely the oc_cart, with a combined key using api_id,customer_id,session_id,product_id,recurring_id.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by nonnedelectari » Thu Oct 17, 2024 7:13 pm

twdre wrote:
Thu Oct 17, 2024 6:04 pm
nonnedelectari wrote:
Thu Oct 17, 2024 5:48 pm
twdre wrote:
Thu Oct 17, 2024 5:34 pm


Thank you for your response.
I did put it already to 5000 . Saddly that also Is not helping

My hoster told me jus a few minutes ago its a timeout door HAProxy.

And now tells me to look if it is possible to let the shoppingcart go arround the database to solve the time out.
I thinks this will not be possible or... ??
As it is on a shared server they dont want to change anything to solve this (something to do with resources I think)
Did you optimize your database, index-wise?
Thank you
Im now looking to this post if this could be the sollution: viewtopic.php?t=227675&hilit=memcached+db
Yes, those will add the obvious basic indexes which should have been there by default.
Yet, they may not be enough, you may have to use sql explain functions on the queries which are executed to see if more indexes (or less) are better.
Then again, maybe Neuhoff is correct, a shopping cart is not the right platform to order thousands of individual products (which poor soul inputs those?), maybe an API or batch process would be better.

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by simple-opencart » Thu Oct 17, 2024 9:33 pm

twdre wrote:
Thu Oct 17, 2024 5:15 am
What can I do to solve this as it is a wholesale site which should be normal to have a lot of product in the basket
OpenCart makes a lot of requests in the cart.
Take a look at my module, it will probably help you.

https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=45124

New member

Posts

Joined
Fri Oct 19, 2018 4:01 pm

Post by paulfeakins » Thu Oct 17, 2024 9:51 pm

JNeuhoff wrote:
Thu Oct 17, 2024 7:04 pm
You still haven't explained why you need such a strange scenario in the first place. Do you really expect a customer to spend hours or days to add thousands of products into a shopping cart?
It would be good to know the answer to this so we can perhaps suggest another solution.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by twdre » Fri Oct 18, 2024 1:14 am

paulfeakins wrote:
Thu Oct 17, 2024 9:51 pm
JNeuhoff wrote:
Thu Oct 17, 2024 7:04 pm
You still haven't explained why you need such a strange scenario in the first place. Do you really expect a customer to spend hours or days to add thousands of products into a shopping cart?
It would be good to know the answer to this so we can perhaps suggest another solution.
Its not so strange.
Customers are retail shops filling up their cart for some period or week (I dont know exactly how long they are doing this) . Depends what they are selling in their shop and at the end of their period they go to check out.

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by twdre » Fri Oct 18, 2024 1:16 am

simple-opencart wrote:
Thu Oct 17, 2024 9:33 pm
twdre wrote:
Thu Oct 17, 2024 5:15 am
What can I do to solve this as it is a wholesale site which should be normal to have a lot of product in the basket
OpenCart makes a lot of requests in the cart.
Take a look at my module, it will probably help you.

https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=45124
Thanx . I will give it a try

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by JNeuhoff » Fri Oct 18, 2024 5:19 pm

This is a strange scenario. The OpenCart checkout is not designed for this. Perhaps a more useful approach would be to implement a modified version of a wishlist, and then whenever the retail customer decides to submit an order, the wishlist could be converted into a cart in one single step.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by paulfeakins » Fri Oct 18, 2024 7:17 pm

twdre wrote:
Fri Oct 18, 2024 1:14 am
Customers are retail shops filling up their cart for some period or week
I see. Well OpenCart should easily be able to handle it, it sounds like a problem with your web host.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by twdre » Sat Oct 19, 2024 1:12 am

simple-opencart wrote:
Thu Oct 17, 2024 9:33 pm
twdre wrote:
Thu Oct 17, 2024 5:15 am
What can I do to solve this as it is a wholesale site which should be normal to have a lot of product in the basket
OpenCart makes a lot of requests in the cart.
Take a look at my module, it will probably help you.

https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=45124
Thanx fiked it with you module together with

https://www.opencart.com/index.php?rout ... n_id=41997

Site is flying till now. Hopefully it stays like this
Thanks to all of you who put me in the right direction

New member

Posts

Joined
Sat Mar 28, 2015 4:52 am

Post by nonnedelectari » Sat Oct 19, 2024 7:34 pm

You can basically cache all select queries, not just for the shopping cart by using a hash table in the function query of the file system/library/db.php
add the hash table:

Code: Select all

class DB {
	private $adaptor;
	
	// declare the hash table
	private $hash_table = array();


Replace the query function with:

Code: Select all

	public function query($sql, $cache = true) {
		
		// remove tabs, linefeeds and spaces
		$sql = str_replace("\t",' ',$sql);
		$sql = str_replace("\r\n",' ',$sql);
		$sql = str_replace("\n",' ',$sql);
		$sql = preg_replace('/\s+/', ' ', $sql);

		// use the hash table if so requested and the query does not contain inserts, updates, replacements or deletes
		if ($cache && !preg_match('/(insert|update|replace|delete)/i', $sql, $matches)) {
			// hash the query
			$hash = hash('sha1',$sql);
			
			// uncomment for tracing
			//error_log('SQL Caching...: '.$sql);
			
			// check if results are already in the hash table for this query
			// if yes, use those results
			// if no, perform the normal query and put the results in the hash table
			if (!empty($this->hash_table[$hash])) {
				// use the results from the hash table
				$result = $this->hash_table[$hash];
				
				// uncomment for tracing
				//error_log('SQL hash found: '.$sql);
			} else {
				// perform a normal DB query
				$result = $this->adaptor->query($sql);
				
				// save the results in the hash table
				$this->hash_table[$hash] = $result;
				
				// uncomment for tracing
				//error_log('SQL hash not found, hashing: '.$sql);
			}
		} else {
			// uncomment for tracing
			//error_log('SQL No Caching: '.$sql);
			
			// perform the normal query
			$result = $this->adaptor->query($sql);
		}
		return $result;
	}
This basically eliminates certain repetitive db queries, seo url and layout related queries are very repetitive throughout OC.
From the shopping cart thru to checkout, product related queries are very repetitive.
if "CartCacher" does something similar or better, go with that.
[/quote]

Active Member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by paulfeakins » Mon Oct 21, 2024 6:50 pm

twdre wrote:
Sat Oct 19, 2024 1:12 am
Site is flying till now. Hopefully it stays like this
Thanks to all of you who put me in the right direction
So please add [SOLVED] to the start of the post title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 16 guests