"too many connections" is back

Practice posts and questions about the boards. The registration code for this board is 'Th3G@m|ngD3n' (Note the use of numbers and symbols!)

Moderator: Moderators

Post Reply
fectin
Prince
Posts: 3760
Joined: Mon Feb 01, 2010 1:54 am

"too many connections" is back

Post by fectin »

Warning: mysql_connect() [function.mysql-connect]: User niftymes_tgdmbpr already has more than 'max_user_connections' active connections in /home2/niftymes/public_html/tgdmb/db/mysql4.php on line 48
phpBB : Critical Error
I got this a couple minutes ago. I know there was a separate thread on it before, but I couldn't find it.

Edit: And now I'm getting it a whole bunch. Like every other link. Am I the only one?
Last edited by fectin on Tue Jul 05, 2011 7:49 pm, edited 1 time in total.
User avatar
tzor
Prince
Posts: 4266
Joined: Fri Mar 07, 2008 7:54 pm

Post by tzor »

YOU ARE NOT ALONE!

Although I'm not getting it at this moment.

I suspect we are being visited by bots on a frequent basis.

After I posted I went to the main page

In total there are 35 users online :: 8 Registered, 0 Hidden and 27 Guests
Last edited by tzor on Tue Jul 05, 2011 7:55 pm, edited 1 time in total.
User avatar
Meikle641
Duke
Posts: 1314
Joined: Mon May 05, 2008 8:24 pm
Location: Ontario, Canada
Contact:

Post by Meikle641 »

Just got that error myself.
Official Discord: https://discord.gg/ZUc77F7
Twitter: @HrtBrkrPress
FB Page: htttp://facebook.com/HrtBrkrPress
My store page: https://heartbreaker-press.myshopify.co ... ctions/all
Book store: http://www.drivethrurpg.com/browse/pub/ ... aker-Press
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Re: "too many connections" is back

Post by Zherog »

Thanks for the heads up.
fectin wrote:I know there was a separate thread on it before, but I couldn't find it.
It didn't have its own thread; the previous discussions are in the "report bugs" thread. Probably better to have it out here on its own, though.
tzor wrote:In total there are 35 users online :: 8 Registered, 0 Hidden and 27 Guests
That's certainly not excessive...
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
User avatar
tzor
Prince
Posts: 4266
Joined: Fri Mar 07, 2008 7:54 pm

Re: "too many connections" is back

Post by tzor »

Zherog wrote:That's certainly not excessive...
No it's not, but if they are bots, they may be using resources faster than normal humans merely because they are scanning a page in milliseconds while normal humans often take a minute looking at the results of a web page query. Thus if 30 humans were on line it would be rare for two of them to hit the database at the same time, but or 30 bots, at any given moment several may be hitting the database.

Just my wild speculation, since i don't know the max database connection number for this system.
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Post by Zherog »

I did a bit more digging last night, and for the first time my searching turned up an answer that points to a bug in the software rather than a server-side setting. If the source I found is correct, phpbb has a bug that makes it so not all db connections are closed after they're used. Eventually, the open connection will time out and release itself, but if enough of them hang at one time (such as when a crawler is on the site), then we get the error.

The source I found also had a very simple fix that can be added to any page. It goes out, finds SQL connections older than some specified time, and kills them. I'm going to find some time this week to make those changes, and then we'll see if the issue goes away.
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Parthenon
Knight-Baron
Posts: 912
Joined: Sat Jan 24, 2009 6:07 pm

Post by Parthenon »

If you've already made those changes then it hasn't helped- I just got another too many connections error twice in a row about a minute ago.
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Post by Zherog »

I haven't yet made the changes. Been losing a fight with the scheduling monster. Thanks for the update, though.

edit: also, I deleted one of your double posts... just so nobody wonders where it went.
Last edited by Zherog on Thu Jul 14, 2011 6:21 pm, edited 2 times in total.
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Post by Zherog »

note to self: get off your lazy ass and fix the error already, you lazy fucking bastard...
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
fectin
Prince
Posts: 3760
Joined: Mon Feb 01, 2010 1:54 am

Post by fectin »

Would it work t write a cronjob that kills all old connections every 15 min?
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Post by Zherog »

I've just now installed a fix. While I can't test it - because I don't have the capacity to reproduce the error - everything seems to be functioning normal. Essentially, every time anybody loads the index page it'll go out and find any SQL connections that are more than 500 seconds old and kill them. I can adjust that number up or down as needed. My hunch is I'll need to reduce it once or twice, but I'd rather start out there.

If anybody has any issues loading pages today (Sunday July 31st) please send me a PM so that I'll get an email notification. I can revert back to the previous code if necessary. If anybody encounters the "too many connections" error going forward, please post the info in this thread, and I'll look into getting the number of seconds reduced.

Sorry for the delay getting it fixed; hopefully this wraps up the issue.

*

Fectin -- your idea would seem to work to me, except I don't know if I have access to crontab on the server or not. The solution I have, instead, just looks for the old connections whenever that page loads and kills them. Same effect, different way of getting to it.
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Post by Zherog »

Alright, so no PMs and no posts since I made the changes likely means I didn't fuck anything up. Yay me!

Hopefully this issue is behind us now. Of course, if anybody encounters it then certainly go ahead and post here, and I'll see if I can find anything else on the error.
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
User avatar
Zherog
Knight-Baron
Posts: 907
Joined: Fri Mar 07, 2008 7:54 pm

Post by Zherog »

Well, so much for it being fixed... I just got the message. At some point this week I'll try adding the code to a page that gets loaded more often, like the Forum or Thread page, rather than just the index.
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
fectin
Prince
Posts: 3760
Joined: Mon Feb 01, 2010 1:54 am

Post by fectin »

It's back again. I've been getting rather a lot of them.
User avatar
Prak
Serious Badass
Posts: 17340
Joined: Fri Mar 07, 2008 7:54 pm

Post by Prak »

today, 27 minutes ago.
Warning: mysql_connect() [function.mysql-connect]: User niftymes_tgdmbpr already has more than 'max_user_connections' active connections in /home2/niftymes/public_html/tgdmb/db/mysql4.php on line 48
phpBB : Critical Error

Could not connect to the database
Cuz apparently I gotta break this down for you dense motherfuckers- I'm trans feminine nonbinary. My pronouns are they/them.
Winnah wrote:No, No. 'Prak' is actually a Thri Kreen impersonating a human and roleplaying himself as a D&D character. All hail our hidden insect overlords.
FrankTrollman wrote:In Soviet Russia, cosmic horror is the default state.

You should gain sanity for finding out that the problems of a region are because there are fucking monsters there.
User avatar
Cynic
Prince
Posts: 2776
Joined: Fri Mar 07, 2008 7:54 pm

Post by Cynic »

It's been appearing on and off today.
Last edited by Cynic on Mon Oct 10, 2011 5:04 pm, edited 1 time in total.
Ancient History wrote:We were working on Street Magic, and Frank asked me if a houngan had run over my dog.
User avatar
shadzar
Prince
Posts: 4922
Joined: Fri Jun 26, 2009 6:08 pm

Post by shadzar »

massive too many connections and 500 server errors, within the past 2 hours.
Play the game, not the rules.
Swordslinger wrote:Or fuck it... I'm just going to get weapon specialization in my cock and whip people to death with it. Given all the enemies are total pussies, it seems like the appropriate thing to do.
Lewis Black wrote:If the people of New Zealand want to be part of our world, I believe they should hop off their islands, and push 'em closer.
good read (Note to self Maxus sucks a barrel of cocks.)
Post Reply