Jump to content

mysqli error


nagashiwa

Recommended Posts

Hello, even after upgrading I get this error each time.
I wonder if someone knows how to fix this.

Quote

Warning: mysqli::mysqli(): (HY000/1040): Too many connections in .../classes/db/mysqli.class.php on line 33

Warning: mysqli_options(): Couldn't fetch mysqli in ...classes/db/mysqli.class.php on line 35

Fatal error: Too many connections in ...classes/db/mysqli.class.php on line 38

Or webhost said the follow thing

Quote

This is to inform you that MySql connections cannot be increased on shared servers. We recommend you to optimize your database and close mysql connections in your script at regular intervals.
 

However, I'm not a developer myself.
So I've no clue how to fix this problem

This problem also didn't happen a while ago.
So I hope someone over here can help and want to teach me to solve this problem

Link to comment
Share on other sites

CubeCart (in common with many other applications) doesnt close database connections as regularly as is perhaps could but to be honest, unless you have a huge number of concurrent customers then your current hosting is far too restrictive and you should look to change to a better hosting company.  We have some very large CubeCart customers with huge numbers of visitors that operate perfectly well on our shared hosting services.

Ian

Link to comment
Share on other sites

Quote

Check for re-openings of your database connections (mysqli_connect). There should

only be one per script (!) and usually you should take care of reusing open

connections OR close them properly after script execution (mysqli_close)

I just did check the .php file the error lines.

However the error appeared in these lines -_-

/**

 * MySQL database controller

 *

 * @author Technocrat

 * @author Al Brookbanks

 * @since 5.0.0

 */

 

Link to comment
Share on other sites

2 hours ago, nagashiwa said:

we already pay a lot for our host (-_-)
It's paid for a year, so still need a few months.
But then at least I know we should move and not stay with the host we are currently under.

@havenswift-hosting
I wanted to check your website, to check up your costs, but it isn't loading at all.

I suppose it depends on what you mean by a lot but regardless of amount paid, they aren't even allowing you enough resources to run CubeCart properly !  To stay with them and put up with a non working site doesn't seem logical !

As far as our site is concerned, it is currently and has been working perfectly

Ian

Link to comment
Share on other sites

8 minutes ago, Noodleman said:

150 per server isn't a lot, if the server is overloaded with users ;)

@Noodleman
So it's simply to less for +66 registered webshop users now? Not that all users check the website at the same time tho. It's just a small webshop.

Anyway what about this hosting?
https://www.hosting24.com/features.php

Still to less?

 

Link to comment
Share on other sites

Using a "what if" example... most sites will only use one, or two connections (unless it's very poorly written). As a site gets busy, if a connection is in use then a new connection will be established. So, busy sites can use many connections.

What if, of those 66 users (66 sites), some of them are really busy, and used say 5 or even 10 connections each?

You can see how it's quite easy, and very plausible to hit the servger limit of 150 connections. It happens a LOT on shared hosting, especially those hosting provides who overload DB servers. It's why for me (as a techy guy) I personally will only ever use a VPS, since I have total control of the server and can prevent resource limits from being exhausted / abused.

Link to comment
Share on other sites

The limit you are likely reaching is the 15 connections per account which isn't a lot and certainly not enough for 66 concurrent users !  I dont know why you cannot see our site but can assure you that it is working perfectly and have multiple customers accessing it consistently today - you could try a trace route.

 

Link to comment
Share on other sites

15 minutes ago, Noodleman said:

Using a "what if" example... most sites will only use one, or two connections (unless it's very poorly written). As a site gets busy, if a connection is in use then a new connection will be established. So, busy sites can use many connections.

What if, of those 66 users (66 sites), some of them are really busy, and used say 5 or even 10 connections each?

You can see how it's quite easy, and very plausible to hit the servger limit of 150 connections. It happens a LOT on shared hosting, especially those hosting provides who overload DB servers. It's why for me (as a techy guy) I personally will only ever use a VPS, since I have total control of the server and can prevent resource limits from being exhausted / abused.

I'm not really technical.
But are there any good VPS to buy who aren't that expensive? And just good for a small website plus webshop. Maybe webshop will have in the future about 1000 registered users.

Website itself well will never exceed 500mb I guess. but surely never 1gig.
Also we want to keep the possibility open to co-host small bandwebsites. (so kinda add-on)

hostpapa itself cost this: https://www.hostpapa.com/web-hosting-plan/vps-hosting/


But what about to get a reseller account? would you still have the same thing?

 

however what if I would do "Optimize MySQL Database with phpMyAdmin"
Would that help?

 

--

@havenswift-hosting
Maybe it will work tomorrow

Link to comment
Share on other sites

8 hours ago, nagashiwa said:

I'm not really technical.  But are there any good VPS to buy who aren't that expensive? And just good for a small website plus webshop.

however what if I would do "Optimize MySQL Database with phpMyAdmin". Would that help?

@havenswift-hosting.  Maybe it will work tomorrow

A VPS is generally not a good idea for non technical users and should not be needed for most CubeCart sites - as I already said, a properly configured shared hosting server can support some very large sites

Optimizing your database can be a good idea but will have no effect on this issue

Our website has been working perfectly - you seem to be the only person not able to see it - what URL are you trying to go to.

Your current hosting is too restrictive and there is nothing you can do except get better hosting

Link to comment
Share on other sites

17 hours ago, havenswift-hosting said:

A VPS is generally not a good idea for non technical users and should not be needed for most CubeCart sites - as I already said, a properly configured shared hosting server can support some very large sites

Optimizing your database can be a good idea but will have no effect on this issue

Our website has been working perfectly - you seem to be the only person not able to see it - what URL are you trying to go to.

Your current hosting is too restrictive and there is nothing you can do except get better hosting

what if I would switch to a different webshop system, so not using cubecart?  Many use Magento  or wordpress WooCommerce .  or would the same thing happen?

Or how many connections should I need? I found a website who gives 25 connections.

 

 

I try to access: https://www.havenswift-hosting.co.uk
But even today nothing. (>_<)

Link to comment
Share on other sites

I can't answer your questions about hosting, but I CAN tell you that I was able to follow your provided havenswift url, and the page opened very easily. Have you tried accessing with a different browser or device? Somehow there must be a block on that IP

I've changed hosting several times over the years, but mostly because of Customer Service issues - not number of simultaneous connections.

Link to comment
Share on other sites

Magento uses massively more resources and even WooCommerce is higher / about the same as CubeCart - it is nothing to do with CubeCart but is the hosting package you are running as has been mentioned by several different people on here.

We have many hundreds of customers (a number of them are regular users on this forum) and a large number of them access our own website on a daily basis.  I have checked your IP address (as shown on these forums) and it is not blocked on the server running our own company website.  Have you tried running a trace route as I previously suggested - that will immediaqtely indicate where the problem lies - download and run that on your PC / device and PM me the output

Link to comment
Share on other sites

19 minutes ago, Dirty Butter said:

I can't answer your questions about hosting, but I CAN tell you that I was able to follow your provided havenswift url, and the page opened very easily. Have you tried accessing with a different browser or device? Somehow there must be a block on that IP

I've changed hosting several times over the years, but mostly because of Customer Service issues - not number of simultaneous connections.

I have, and I just asked a friend too.
But it seems site is kinda blocked in my country. It's really loading slow and if its loaded I see a website without any CSS style.
But if I use a online proxy I can access it...

5 minutes ago, havenswift-hosting said:

Magento uses massively more resources and even WooCommerce is higher / about the same as CubeCart - it is nothing to do with CubeCart but is the hosting package you are running as has been mentioned by several different people on here.

We have many hundreds of customers (a number of them are regular users on this forum) and a large number of them access our own website on a daily basis.  I have checked your IP address (as shown on these forums) and it is not blocked on the server running our own company website.  Have you tried running a trace route as I previously suggested - that will immediaqtely indicate where the problem lies - download and run that on your PC / device and PM me the output

Alright thank you.
I will pm you the details from the trace route
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...