Raised This Month: $12 Target: $400
 3% 

MySQL |Connection| Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 08-30-2011 , 17:17   MySQL |Connection| Problem
Reply With Quote #1

Hello,

I have a problem with open MySQL connection, it seems like every time I do a SQL_ThreadQuery with my tuple, it does what is it suppose to do and give me a callback with all data and all is fine, but after I got the callback and return from the function it never closes the connection (It closes the connection before the callback probably but). I can't confirm if this happens to every connection, or if this happens on another server with the same plugins running. And I can neither tell if this happens to SQL_ThreadQuery only, I have some normal connections in there too.

The plugins are connecting to an external server, it took me few weeks to figure out why players couldn't connect to the server, and why the website started to give nasty MySQL server connections errors randomly. First problem was that the MySQL server couldn't handle more connections, so I raised the count a bit, It worked out for a while, to finally completely crash again. So the SHOW PROCESSLIST command was showing like 300 open connections from my HLDS server.

So I started to kill them manually, and it worked out good, the website was finally alive again. After some hours I found how to change the time the server will keep the connection open, so I lowered it to 3 minutes instead of the default, which is 8 hours! And the problem was permanently fixed.

Until the HLDS server starts to refusing players again, I started to look where I ended. Now it shows that the MySQL server stops the connection, it doesn't shows up in either the SHOW PROCESSLIST nor `netstat -a`, on the server side. On the HLDS server side, all connections are still there with a state like CLOSE_WAIT in netstat, And I'm near 100 open connections that have this state to my MySQL server. If I close the HLDS server completely, all connections will drop off eventually. Does someone have any idea what is happening here? I have thought of so many possibilities but now I feel a little bit lost, does anyone have a little thought of what could cause this?

I gonna do some tests this week which will include testing on other server, disabling all plugins except one test plugin that does all kinds of connections.

Oh, and I'm running debian 64-bit with a 2.6.35 kernel.

Greatful for any ideas on this.
__________________
Retired.
Xalus is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode