News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Too many connections to mysql left open?

Started by amcgator, March 23, 2015, 10:19:21 AM

Previous topic - Next topic

amcgator

Hello,

I'm using version 2.0.9 of SMF.  I'm on a shared host and am limited to 30 concurrent connections to the MySQL database.  I'm running out of available connections because it seems SMF is leaving them open too long (nothing else I have uses the database).  This is causing my forums to not load and give the error "Connection Problems Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.".  When I print the mysql error "User '***' has exceeded the 'max_user_connections' resource (current value: 30)" so that is why I think this is the problem. 

Has anyone else seen this?  What can I do to fix it? 

The forum currently has around 1k members that are active during a week. 

Thanks for your help and direction.

margarett

Check if you have "Use a persistent connection" UNCHECKED in Admin --> Configuration --> Server Settings --> Database and Paths
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ziycon

Welcome to SMF amcgator, check what margarett asked but can you also tell us who your host it please?

amcgator

Hi,

Thanks for the quick replies - "Use a persistent connection" is not checked.   :-\

GoDaddy is the host I'm using.  I have seen on the forums that it is not a favorite but was hoping that there might still be a solution besides changing hosts since the error is pretty specific.

Thanks

ziycon

Unfortunately, Go Daddy are an overseller and due to the nature of oversellers they say unlimited x, y and z but in reality they have hard set limits on fair usage were they wont budge and try to up sell you to a more expensive package.

Its a very common practise, you need to do some more homework before purchasing a hosting package to make sure it will suit your needs for the present and will grow with your site growth in the future.

margarett

How many users do you have online at the same time?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

amcgator

It looks like from our Awstats we have on average 5k visitors a day. Under the cpanel Webalizer it says 'hits per hour' average at 17k.  Is there a better metric or place I can look for this?

margarett

SMF itself should tell you "users active in last 15 minutes" which is also a good metric.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

amcgator

Neat!  I hadn't noticed that.  Thanks :)

It said 85 guests and 54 users. 


margarett

Well, in this case yes, you're maximum number of connections might be exhausted easily...
All connections are closed upon execution (unless there's a poorly coded MOD that forgets to close any and it has to wait for the defined timeout in the server). But having that many users online at once can easily create several simultaneous connections that go over your limit...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

amcgator

Ok thank you.  I guess your recommendation would be to move to a non-shared server then? 

Or what connection limit could our site tolerate do you think?  If we wanted to plan to handle say ~150 users what could max connections be set to and not normally be hit? 

You have been very helpful thanks.

margarett

No, you can keep shared hosting (although you should be a bit on the edge). But be sure to use a non-oversold host, one that delivers what they promise.

Take a look at our Paid Hosts board, you can see some recommendations.
Be sure to check your file system usage, though. These "unlimited" hosts do allow you to spend a large amount of disk space, while "good" hosts have lower (but real!) limits ;)

edit: check this post
http://www.simplemachines.org/community/index.php?topic=532464.msg3784458#msg3784458
(the whole topic is interesting ;) )
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

amcgator

Ok thanks very much - that was a very good read. 

Is 30 a low number for the connection limit on the mysql database for SMF with say 150 concurrently active users?  If so what number do you think I should look for when searching for a new host?

Thanks

margarett

No need to concern yourself with such "technicalities" ;)
When you contact a potential host link them your forum and the stats that you presented to us (heck, link them this topic :P ), they will know what to do ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

amcgator

Ok.  Thanks very much.  Have a good day

Advertisement: