PDA

View Full Version : [Fixed] MySQL: SuperHero mod not closing connections?


FeliXen
07-28-2005, 11:06
I'm running AMX Mod X 1.01, Metamod X from Hullu and latest SuperHero mod on Linux Debian 2.4.18-686-smp. The MySQL server is 4.0.16 running on Windows 2003, web server edition (not hosted the same place as the SH server).

The server works fine, but when watching the graph of my MySQL server's connection usage it slowly grows up and reaches 100% connection usage, which means that my MySQL server is being put out of function for both the SH mod cs server and the rest of my applications relying on the server.

It seems to me like superhero mod isn't closing its connections, which results in this - but can this be true?
Can anyone see anything wrong with my setup, that could result in this?

I concider that it must be a bug of some kind, but please, any suggestions are welcome.
For now i have turned off SaveXP, untill i find a solution.

Thanks.

123
07-28-2005, 11:30
I would say that it prob. is your mysql server that does not have enough space avalible...

FeliXen
07-28-2005, 11:39
There's more than enough discspace, but do you mean the MySQL server setting max_connections? It's set to 100, which is the default value as far as i know.

My War3FT server has the same setup (same MySQL server, newer Debian kernel though), and it only uses 10-15% of the connections available.

123
07-28-2005, 11:43
No.. I mean, doesn't the mysql server get a max amount of diskspace ?
I have no problem, with it, and I have had 3 servers running on the same mysql server...
If you wan't me to host it for you, untill you get your own to work, then just contact me om msn.

FeliXen
07-28-2005, 11:53
Hi,

Thanks for the offer, that's very generous of you and highly appreciated. For now i would like to try getting it to work and i'll survive wiithout the savexp for a short while (or well, my users will hopefully :o).
I host the MySQL db my self, so i have no limit configured on how much the database may take, and there's only like 30-40 players in the database right now (http://www.csweb.dk/?server/stats/sh/10/).

I have a few questions related to your setup if it's okay.
- Which version of MySQL do you run and on which OS?
- Have you got any servers that are hosted remotely, using your MySQL server?

Thanks again.

123
07-28-2005, 12:22
I don't controle my mysql server, I use mfhosting.
All the cs servers I have had connected, have been remote.

FeliXen
07-28-2005, 12:41
Alright, I'll try a few things and if it keeps bugging me then perhaps i'll take you up on your offer and see if it runs smoothly on your MySQL server, because then it must be my MySQL setup that's wrong.

Thank you very much for the help so far.

jtp10181
07-28-2005, 21:39
what is your "sh_mysql_persistent" setting?
try changing it.

Also if you check the code I am telling amx(x) to close the mysql connection

you never stated your SH version, and you should also use the stock metamod, there usually problems when not using the stock metamod.

I'm guessing you have persistant turned on, so then it doesn't close the connection and should reuse the orginal one, but for some reason it cant use the old connection (something with your setup perhaps?) so it makes a new one.

FeliXen
07-29-2005, 06:27
sh_mysql_persistent is set to 0 (off). 123 suggested that i tried changing sh_endroundsave to 0, and since i did that last night it hasn't overloaded my MySQL server.

As i said i'm using the latest version of superhero mod (stable, not from cvs). Metamod X has a lot of improvements compared to Metamod, which is why I'm using it. I tried with both versions, and both overloaded the MySQL server.

I have a War3FT server saving to the exact same database and from the same AMXX setup (except -superhero+war3ft) also on a Debian box, it works fine. But for now, i'm satisfied with the sh_endroundsave fix.

Thanks for the suggestions!

jtp10181
07-29-2005, 06:39
well if you look in my code I am closing every single connection that gets opened. SO I dont know what the prob could be.

Almost every other mysql thing I know of uses persistant connections. If your machine is local to the mysql server I would really try turning persistant connection ON and enround save ON

see if that fixes it, I would really like to know.

FeliXen
07-29-2005, 06:51
The server is placed remotely, but do you still want me to try it?

jtp10181
07-29-2005, 07:17
you can, sometimes remote machines might drop the connection and confuse the crap out oh SH, but i would still like to know if it fixes it.

FeliXen
07-30-2005, 12:47
Since i changed the setting to persistant and turned endround saving back on (did it right after your post yesterday), there havent been any overloads - the load has actually been pretty stable on the MySQL server.

This seems to be the solution, so i'll stick with this. Thanks for the help!

jtp10181
07-30-2005, 14:32
hmmm... could be a bug in amxx, where its not closing the connections. I'll have to check it out.

jtp10181
07-31-2005, 09:33
this was actually a small glitch in my logic. When persistent was off it would still leave open a stale connection in certain functions. Although in my case it kept reusing it this connection instead of making a new one every time. But I still fixed it because it was defeating the purpose of having persistent connections disabled. Will be committed to CVS later today. (superheromodmysql.inc)