Page 1 of 1

Opencart not closing connections

Posted: Tue Aug 13, 2019 5:50 pm
by Evilonion
Hi
For some reason the past few months the site has been getting increasingly slow.
Error logs show a connection issue and after discussing with my host its hitting the max connections of 30 allowed.
They have said connections are staying open.

How would I fix this? as everything has been mostly running fine until this issue.

Oc 3.02 uptheme with seo backpack and nitro pack.

Re: Opencart not closing connections

Posted: Tue Aug 13, 2019 6:59 pm
by letxobnav
the only way that db connections stay open (sleeping) is when you use persistent db connections.
Perhaps that nitro pack alters the default db connections into persistent connections, ask them.

Re: Opencart not closing connections

Posted: Wed Aug 14, 2019 3:57 am
by thekrotek
Don't use NitroPack. Just don't. It messes with the system pretty bad. As for OpenCart, it DOES close all the connections.

Re: Opencart not closing connections

Posted: Wed Aug 14, 2019 5:55 pm
by paulfeakins
thekrotek wrote:
Wed Aug 14, 2019 3:57 am
Don't use NitroPack. Just don't. It messes with the system pretty bad. As for OpenCart, it DOES close all the connections.
I'm not doubting @thekrotek's experience or expertise but we actually do recommend Nitropack and think it's great.

Re. this issue, what is the size of your log file?

Re: Opencart not closing connections

Posted: Wed Aug 14, 2019 7:15 pm
by thekrotek
paulfeakins wrote:
Wed Aug 14, 2019 5:55 pm
I'm not doubting @thekrotek's experience or expertise but we actually do recommend Nitropack and think it's great.
It's messy, you can't argue with that :-)

Re: Opencart not closing connections

Posted: Wed Aug 14, 2019 7:20 pm
by paulfeakins
thekrotek wrote:
Wed Aug 14, 2019 7:15 pm
It's messy, you can't argue with that :-)
It is quite complex, like Magento or Journal, but it does seem to work well in our experience and when it doesn't, their support is good.

Re: Opencart not closing connections

Posted: Wed Aug 14, 2019 7:59 pm
by thekrotek
paulfeakins wrote:
Wed Aug 14, 2019 7:20 pm
It is quite complex, like Magento or Journal, but it does seem to work well in our experience and when it doesn't, their support is good.
Magento is the worst and most messy e-commerce framework ever created. Journal is the most messy OC theme ever created. Not the best examples to compare with for sure :-)

Re: Opencart not closing connections

Posted: Wed Aug 14, 2019 8:07 pm
by paulfeakins
thekrotek wrote:
Wed Aug 14, 2019 7:59 pm
Magento is the worst and most messy e-commerce framework ever created. Journal is the most messy OC theme ever created. Not the best examples to compare with for sure :-)
I agree! Which is why I used them as examples of too much complexity, but Nitropack is nowhere near that bad!

Re: Opencart not closing connections

Posted: Sun Aug 18, 2019 8:28 am
by Evilonion
So I disabled seo backpack and nitro pack
Cleared the error logs and left it for a couple of days.

The log now gets about 30 errors a day saying the same thing. It's still at max connections.
My host seems to think 30 is enough but in order for more I'd have to upgrade to vps.
For a vps to have double that amount I'd need a 4gb which seems insane for a cart that just gets 2000 visitors a month??

Re: Opencart not closing connections

Posted: Sun Aug 18, 2019 9:32 am
by letxobnav
check if some of those connections are in sleep status.
If some are, you still have a bad modification somewhere or maybe your host has put their Mysql server on persistent connections.

The number of active connections depend on how many url's you service concurrently, there may be peaks with a fast spider but I do not expect your site to spit out 30+ url's at the same time during normal operations.

Re: Opencart not closing connections

Posted: Sun Aug 18, 2019 9:37 am
by Hussain_alikaka
I have same problem, need to know what to do

Re: Opencart not closing connections

Posted: Sun Aug 18, 2019 1:24 pm
by thekrotek
Evilonion wrote:
Sun Aug 18, 2019 8:28 am
The log now gets about 30 errors a day saying the same thing. It's still at max connections.
I remember having similar issue with Joomla on SiteGround servers. These guys even worse and limit connections to like 5 or 10, don't remember exactly how much. I wasn't that experienced those days and wasn't able to find the root of the issue.

I don't really think problem is with OpenCart, because, like I previously said, it manages queries more or less good. There're issues like using INSERT in foreach() construct and similar stuff, but it is related to optimization mostly. Closing connections is a different kind of issue and, I'm afraid, it can be addressed only personally for it's too specific. If you want I can try to look into this on your server. Drop me an email or text in Skype and we'll discuss the matter.

Re: Opencart not closing connections

Posted: Tue Sep 29, 2020 5:40 am
by imcdonald83
@Evilonion: Did youevef resolve this issue? I'm having the same problem and can't find what is causing it.