Mysql error

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Mysql error

Post by FCB_Simon » Sat Jan 06, 2007 12:47 pm

Code: Select all

Warning: mysql_connect() [function.mysql-connect]: User  has already more than 'max_user_connections' active connections in location on line 48

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in location on line 330

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in location on line 331
phpBB : Critical Error 

Could not connect to the database 
What's this? Keep getting it.
FCB_Simon
www.fcbes.com

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69292
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Post by KevC » Sat Jan 06, 2007 12:52 pm

Contact your hosts.
User has already more than 'max_user_connections' active connections


They have a limit set on the maximum number of connections your site can have. You're hitting your limit.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Post by FCB_Simon » Sat Jan 06, 2007 12:56 pm

Thank you fellow Oxfordian.

The site is fine, it's the forum. Which seems strange.
FCB_Simon
www.fcbes.com

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69292
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Post by KevC » Sat Jan 06, 2007 1:02 pm

It's the database that has the connection limit. That's separate from your web site. I was using site as a general term :) Wish this rain would ease off today.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Post by FCB_Simon » Sat Jan 06, 2007 1:03 pm

Ok - thanks. Indeed, I'm hoping the footie isn't called.
FCB_Simon
www.fcbes.com

FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Post by FCB_Simon » Mon Jan 08, 2007 1:20 pm

Had this reply from my hosts when querying the connections error;

"Each user account is limited to 7 concurrent connections. Providing that the software you are using is cleanly closing the connection and using connections in the correct manner then you should never reach this limit. The limit is in place purely to prevent problems being caused by runaway scripts."
FCB_Simon
www.fcbes.com

FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Post by FCB_Simon » Mon Jan 08, 2007 5:52 pm

Any ideas on the "that the software you are using is cleanly closing the connection and using connections in the correct manner" comment? Is there anything specific I can look for?
FCB_Simon
www.fcbes.com

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Post by espicom » Mon Jan 08, 2007 6:08 pm

Is there anything specific I can look for?


Yes, another host, preferably one who understands how to configure servers properly. They have control over how the connections are made and closed. If they have connections that are not being closed when the script ends, it is because they have specifically told PHP not to close them (it's called "persistent connections"), because they can be reused.

By default, PHPBB does not ask for persistent connections. The "false" in this line from includes/db.php is what says not to ask:

Code: Select all

$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
With that setting, when the script reaches the end of its execution, the connection is supposed to be closed. So, either the host has configure PHP to ignore that, or you are actually having more users connecting at the same time than you're authorized to have... which means the "solution" is to drive away users.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Post by FCB_Simon » Thu Jan 11, 2007 1:24 pm

Done loads of searching around the forum for this.

Hosts tell me it's always been a maximum of 7 concurrent connections.
Forums going down frequently when it's been busier in the past and not gone down.
No new mods added recently which would cause said issue.

max_user_connections = 7
max connections = 60

Forum is going down with approx 7 people on it.

Using 2 different templates on the forum. 1 is modded, 1 isn't. Although some mods make changes to the default forum files (i.e. above the template level).

Not sure whether I should default the un-modded template and see if this has an affect?

I need to renew my hosting account by the end of Jan so I've only got 2 weeks to sort this out :cry:

It's driving me crazy. Hosts have basically washed their hands of it, is their any further information I can ask them? i.e. anything on how they deal with server requests or anything?

Tempted to re-install forum with original template and see how that runs as last attempt before moving to host with no silly max_connection limit.

Any help greatly appreciated, especially as I know this topic has been done to death.

Hosts = flump.net.
FCB_Simon
www.fcbes.com

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Post by espicom » Thu Jan 11, 2007 6:35 pm

7 connection limit does not mean just 7 users, but it means that only 7 simultaneous page requests can be made. This is a very, very small number for a forum with any significant activity! In fact, with some MODs installed, you can max it out on a single page view, because some MODs cause other pages with SQL requirements to be loaded... the wrong combination can kill things with only one or two users. This is only slightly better than using ODBC and MS Access, which limits you to 2 or 3 connections before being overwhelmed.

If you are going to continue with this host, you must minimize the number of MODs you have installed, to keep your time to generate a page in the sub-second range. The longer it takes to process a page, the fewer people your site can support.

Edit: The 60 max connection limit is less than the MySQL default of 100 connections, so your host has probably set this server up with very little resources, and is trying to hide that fact by limiting things. A properly configured MySQL server in a production environment should be able to handle 300 to 1000 simultaneous connections.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

FCB_Simon
Registered User
Posts: 47
Joined: Sun Feb 01, 2004 3:37 pm

Post by FCB_Simon » Thu Jan 11, 2007 6:57 pm

I am now moving hosts. Thanks.
FCB_Simon
www.fcbes.com

Chrisandnat
Registered User
Posts: 1
Joined: Mon Oct 01, 2007 8:30 pm

Re: Mysql error

Post by Chrisandnat » Mon Oct 01, 2007 8:34 pm

My site http://www.CM-UG.com gets the error:


Warning: mysql_connect() [function.mysql-connect]: User 'CMUG' has exceeded the 'max_user_connections' resource (current value: 20) in C:\hosting\webhost4life\member\********\forum\db\mysql4.php on line 48

However if I look at the boards after a moment I see:

Most users ever online was 7 on Mon Oct 01, 2007 2:11 pm


I only have two mods: Textual Confirmation, and an Attachment Mod.

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Mysql error

Post by espicom » Mon Oct 01, 2007 10:32 pm

Twenty connections maximum?

The number of connections, if things are properly set up, is equal to the number of page requests that require SQL access. Most page requests (actually, file requests) do not involve use of SQL, for things like images on the page. You could be having issues with users that are using "caching" software, which makes multiple requests to pre-load pages, but I doubt it.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

Locked

Return to “2.0.x Support Forum”