Ban Management

Ban Management

193k Downloads

Another "too many open connections" suspension from hosts.

minegame30 opened this issue ยท 20 comments

commented

Hi,
My host suspended me for having too many open connections again today. I think they are getting pretty annoyed with me ๐Ÿ‘

This time it was only 1800 connections.
6 servers running the plugin on the latest build, with each one set to a max of 10 concurrent connections.
No other plugins accessing the database.
I've no idea what else it could be...

(p.s sorry about not responding to the last one, I was on holiday and didn't have a connection)

commented

Absolutely certain. Its a separate database as I didn't want other things to interfere with it.

commented

You say it is a seperate database.
Do you have other databases running at the same account at your host?
Do you have other services on the same machine as your minecraft server runs that connects to the database host could cause the problems?

commented

uh...

Yeah, there are other databases. The bans database is hosted on its own machine, separate of anything else.
As it stands right now, nothing at all else is connecting to the database. I even removed the Web Interface in case that was causing the issues.

commented

Just for clarifying: Nothing else connects to the MACHINE where the BanManager database is located, right?

Don't get me wrong, I just want to make absolutely sure that there cannot be any other interferences that could cause this issue than BM :)

commented

Nono, its fine you asking. Its on its own machine as I had my host move it there when it kept having too many connections. It was moved so I could see that it was definitely this database causing issues. :)

commented

Nice service from 'em :D

Edit: So as you use two different machines for BM and MC there seems to be a problem with the TCP stuff... I use BM and MC on the same machine and that's probably using the socket provided...hm no clue. Wait for @confuser

commented

So you have a completely separate MySQL service running on its own machine, with just a single database (no other databases), and only BanManager is making connections to this machine?

commented

Yup, they moved me onto one of their test servers whilst I tried to resolve this.
It was either that or get suspended again :)

commented

Are you 100% sure you have no other plugins connecting to your MySQL database?

commented

I use Nitrous for the hosting.
Its quite probable that its at their end. Ill contact them and ask them.
They told me previously that the connections weren't timing out and the plugin just kept opening connections. (Now, im no MySQL server genius, but doesnt this suggest that they have the "timing out" limit too high? Like the threshold is too high so the connections arent being closed?)
I am looking into switching hosts as they don't have MySQLnd which I also needed in the past.

Which company hosts Frostcasts databases? I might have to look into moving there :)
Or are they privately hosted?
Thanks

commented

Why are you looking for a specific SQL host? Just get some host and install it there.

commented

If you could find out their configuration and possibly paste it here, that would be helpful. Yes, it sounds like their connection timeout is set too high, or they've disabled connections from timing out. That being said ORMLite should really be correctly releasing the connections back to the pool.

Frostcast is collocated in a private data centre

commented

Kaki, im looking to move my entire website, emails and databases somewhere else, not just the SQL's.

Sorry, just checking. You mean the MySQL configuration?
Ill take a look now. (edit, they like to take their time over things like this, ill post when I know)

commented

Who are you hosting with? Not having any problems like this on Frostcast, we have a single MySQL service and a single database for 9 servers, and not just for BanManager. No offence to your host, but the problem could be caused by a misconfiguration on their end.

commented

Okay so, the host does, in fact, have high values on the timeout.
(Reply: We do have high forced wait time outs on the MYSQL server because a lot of addons / plugins on other game servers have single threads that stay alive throughout the whole duration and some don't attempt to re-connect when killed.)

This explains why the database had so many connections.
Does BanManager close the MySQL connection? Or does it leave it to time out?

Ah okay, I thought as much. Thanks anyway :)

commented

That doesn't quite make any sense for them to do that, if like you say they've setup a mysql service just for you to test with.

If they've stuck you on a shared MySQL server, it could get into a state where it starts dropping packets because it's attempting to handle opening of too many sockets at once, not from just your server, but from others. When that happens, BM will re-attempt to open the connection, as in its eyes, the connection failed. In that case, the original connections may not have been closed by MySQL, and BM won't even be aware of them.

commented

They just duped the MySQL setup to a new server and moved the one database over.

Right...so BM will open a new connection because it doesn't know the old ones haven't yet been closed. I think I get you.
So the only way to deal with this is to lower the timeout so the connection is automatically closed?

commented

Based on what you've said, yes/no. Can you clarify which timeout they are referring to exactly, as there are multiple.

commented

Without asking, I only know "forced wait time outs on the MYSQL server". I can ask them again to be sure.

commented

Please ask them to clarify. It sounds like there could be a configuration issue on their end. I'm doubtful the problem exists within ORMLite's pool implementation.