Post by foobarac » Thu May 16, 2019 4:03 pm

***** SOLVED SEE MY POST BELOW ******

OC 3.0.2.0
PHP 7.1 (was 5.6)
Theme: Basel
62 Products (including options)
20 Categories
system setting to count products for categories - turned off
Gzip and Apache caching turned on.
Database has been refreshed, all session and cart tables have little in it.

My webshop (still under UAT) performs extremely fast. Page loads and adds to carts are extremely quick (like 1-2 second load times).

However, the more you add to the cart, the slower it gets. By the time you get to 20 items its like 15-20 second page loads. Likewise if you make a change to the cart (delete an item) it takes around 15-20 seconds but starts to speed up the more you delete.

There are no errors coming up in the error.log and I have tried to research here and on the web but nothing comes up.

This purely looks like a problem just with the cart processing.

Any ideas or help on how solve this ?

Thanks,

Anthony
Last edited by foobarac on Fri Jun 14, 2019 7:39 am, edited 2 times in total.

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by paulfeakins » Thu May 16, 2019 5:32 pm

foobarac wrote:
Thu May 16, 2019 4:03 pm
However, the more you add to the cart, the slower it gets. By the time you get to 20 items its like 15-20 second page loads. Likewise if you make a change to the cart (delete an item) it takes around 15-20 seconds but starts to speed up the more you delete.
And does this happen if you switch back to the default theme? If so the problem is with your theme and you should contact the theme developer.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by thekrotek » Thu May 16, 2019 6:25 pm

There're definitely no issues with cart database queries in OpenCart. 20 items is a very, very small number, it can not slow down the queries.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by foobarac » Thu May 16, 2019 7:56 pm

Hi Paul,

Was in the process of building a copy on a test site. Disabled the theme and yes it's faster.

What I should really ask if there are any ideas (besides pinging the theme developer which I have done) on how to get an AJAX based theme performing quicker ?

Any changes in the config.php or .htaccess files or any other suggestions ?

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by thekrotek » Thu May 16, 2019 10:28 pm

foobarac wrote:
Thu May 16, 2019 7:56 pm
What I should really ask if there are any ideas (besides pinging the theme developer which I have done) on how to get an AJAX based theme performing quicker ?
Depends on which AJAX requests are made. Sometimes database indexing/caching helps.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Fri May 17, 2019 5:56 pm

foobarac wrote:
Thu May 16, 2019 7:56 pm
What I should really ask?
You should ask them to reconsider their career as a developer if they can't make an AJAX request that returns 20 database rows run quickly.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by straightlight » Sat May 18, 2019 1:42 am

This commit can also be useful to know as an information: https://github.com/opencart/opencart/is ... -487515608

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by foobarac » Sun May 19, 2019 1:11 pm

paulfeakins wrote:
Fri May 17, 2019 5:56 pm
foobarac wrote:
Thu May 16, 2019 7:56 pm
What I should really ask?
You should ask them to reconsider their career as a developer if they can't make an AJAX request that returns 20 database rows run quickly.
LOL - I will tell him !

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by foobarac » Sun May 19, 2019 1:32 pm

straightlight wrote:
Sat May 18, 2019 1:42 am
This commit can also be useful to know as an information: https://github.com/opencart/opencart/is ... -487515608
Thanks Starlight, although a different problem being reported, it is centered around the cart and how and when it is updated by OC. It appears some work may need to be done around this to improve the performance especially when you have a loaded cart:

viewtopic.php?t=211273

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by JazzBlueRT » Sun May 19, 2019 3:46 pm

PHP 5.6 is no longer supported by the PHP team . OC 3 runs fine on PHP 7.2. You will get a substantial performance boost with PHP 7+.

------------------------------------------
Retro gifts, toys, games and accessories
https://www.retroactives.com/


User avatar
Newbie

Posts

Joined
Mon Nov 06, 2017 1:34 am

Post by foobarac » Mon May 20, 2019 5:38 am

Yes I have moved to PHP 7.1 and it has improved the situation.

But with a loaded cart you can still get a performance hit when you change pages or try anything processing the cart.

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by thekrotek » Mon May 20, 2019 6:19 am

I'm afraid, the issue is on your side. Probably happens on a certain server configuration. I've added 30+ items to cart and it loaded just fine, didn't notice any drop in performance. Tested it on OC 3, PHP 7.2.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by foobarac » Fri Jun 14, 2019 8:05 am

**** SOLVED ****

I have investigated this problem and have discovered that CORE OpenCart makes a heap re-iterative calls, reloading product items many times during a page load.

For example, Cart\Cart >getProducts() gets called numerous times just to load the home page.

There is no cache so every call to Cart\Cart >getProducts() reloads the entire cart from scratch. The more cart items you have, the more the load time starts to compound.

This is quite amazing considering the maturity and claimed scalability of OpenCart and a lot of opencart experts claiming nothing is wrong with the core code.

Also, Cart\Cart >getProducts() gets called by other simple sub-routines:

Cart\Cart->getTaxes()
Cart\Cart->countProducts()
Cart\Cart->hasShipping()
Cart\Cart->getSubTotal()

Thanks to Mikhail at liveopencart, he has produced a ocmod that basically brings down page load times with carts loaded with many products from 10's of seconds (in my case +25 seconds for +130 cart items) down to seconds (3 seconds for me).

Anyone wanting the fix please contact him at "support at liveopencart.com".

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by thekrotek » Fri Jun 14, 2019 1:36 pm

foobarac wrote:
Fri Jun 14, 2019 8:05 am
There is no cache so every call to Cart\Cart >getProducts() reloads the entire cart from scratch. The more cart items you have, the more the load time starts to compound.

This is quite amazing considering the maturity and claimed scalability of OpenCart and a lot of opencart experts claiming nothing is wrong with the core code.
Nobody says anything about OC 3 stability, everybody says quite the opposite actually. And yes, there's nothing bad in the code, basic cart data is saved in database, which is more than enough. 130 products in the cart is a VERY specific situation, which should be addressed personally. If you have 500K+ products in your store, you will have more slowdowns in different situations and all of them you will have to address personally. OpenCart is NOT here to blame, no matter how badly you want it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by foobarac » Sat Jun 15, 2019 4:15 am

thekrotek wrote:
Fri Jun 14, 2019 1:36 pm
foobarac wrote:
Fri Jun 14, 2019 8:05 am
There is no cache so every call to Cart\Cart >getProducts() reloads the entire cart from scratch. The more cart items you have, the more the load time starts to compound.

This is quite amazing considering the maturity and claimed scalability of OpenCart and a lot of opencart experts claiming nothing is wrong with the core code.
Nobody says anything about OC 3 stability, everybody says quite the opposite actually. And yes, there's nothing bad in the code, basic cart data is saved in database, which is more than enough. 130 products in the cart is a VERY specific situation, which should be addressed personally. If you have 500K+ products in your store, you will have more slowdowns in different situations and all of them you will have to address personally. OpenCart is NOT here to blame, no matter how badly you want it.
130 items was used as a bench mark, but definitely the performance starts to suffer from about 20 items in the cart.

And I was referring to the comments made above including yours pointing it to be my problem. Now you are saying the opposite.

There is no expectation of warranty on my side I have made about 100 code fixes already. However, if you bothered to understand what I am saying, basic cart data doesn't have to be rebuilt 6 times (standard OC 3 code and theme) because you are changing a screen.

The process and code around the cart processing should be refactored but that's up to the keepers.

At least now the problem is documented on the forum and a fix is available.

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by thekrotek » Sat Jun 15, 2019 4:21 am

foobarac wrote:
Sat Jun 15, 2019 4:15 am
130 items was used as a bench mark, but definitely the performance starts to suffer from about 20 items in the cart.
Definitely NOT. Works perfectly with 20-40 items for me. Didn't try to add more.
foobarac wrote:
Sat Jun 15, 2019 4:15 am
And I was referring to the comments made above including yours pointing it to be my problem. Now you are saying the opposite.
Never said the opposite.
foobarac wrote:
Sat Jun 15, 2019 4:15 am
The process and code around the cart processing should be refactored but that's up to the keepers.
Considering that it fits 99.9% of store owners, I doubt it requires any fixing.
foobarac wrote:
Sat Jun 15, 2019 4:15 am
At least now the problem is documented on the forum and a fix is available.
Don't see any fix, only see a reference about some guy, who supposedly have a fix.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by foobarac » Sat Jun 15, 2019 5:03 am

thekrotek wrote:
Mon May 20, 2019 6:19 am
I'm afraid, the issue is on your side. Probably happens on a certain server configuration. I've added 30+ items to cart and it loaded just fine, didn't notice any drop in performance. Tested it on OC 3, PHP 7.2.
oh :choke:

It's up to the developer to release the code, he owns it.

New member

Posts

Joined
Fri Sep 21, 2018 9:46 pm

Post by thekrotek » Sat Jun 15, 2019 5:06 am

I'm glad you learned the quoting on this forum, congratulations. Yet unfortunately I don't see any contradictions in this quote.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 17 guests