AdamR
3rd April 2008, 01:39
I found out today why XP gets reset to level 0 (with -1 medals)...
AMXX's SQL module makes a new connection for each query it executes. It also does not close the connection after the query has finished. This leaves a lot of sleeping connections about from our game servers to the SQL server just waiting to timeout.
If a map comes on that gives loads of XP, many many connections are made because each time you level up, a save query is performed. Too many queries made means any new ones will get rejected with the error "too many connections". This effects loading your XP, saving your XP, and the web site.
If you join a server while there are too many connections, SCXPM will not be able to load your XP and therefore you have nothing. Later on when the connections die down, you leave the server, and your reset XP is saved. That is how you end up with nothing.
If you join a server and see yourself with 0 XP, leave right away or it will be saved like that. Inforn us (preferibly via IRC (http://sc.multiplay.co.uk/irc.php)) of the problem.
The kick in the nuts is there is nothing we can do about it as it's the SQL module's fault, not the individual plugins using it. The SQL module needs to use persistent connections, so that each game server only keeps 1 connection alive and runs all it's queries through the one connection it has. Please support this feature request (http://bugs.alliedmods.net/index.php?do=details&task_id=1557) to get persistent connections in to AMXX.
Increasing the maximum number of connections won't solve much. It would just mean more resources are required.
AMXX's SQL module makes a new connection for each query it executes. It also does not close the connection after the query has finished. This leaves a lot of sleeping connections about from our game servers to the SQL server just waiting to timeout.
If a map comes on that gives loads of XP, many many connections are made because each time you level up, a save query is performed. Too many queries made means any new ones will get rejected with the error "too many connections". This effects loading your XP, saving your XP, and the web site.
If you join a server while there are too many connections, SCXPM will not be able to load your XP and therefore you have nothing. Later on when the connections die down, you leave the server, and your reset XP is saved. That is how you end up with nothing.
If you join a server and see yourself with 0 XP, leave right away or it will be saved like that. Inforn us (preferibly via IRC (http://sc.multiplay.co.uk/irc.php)) of the problem.
The kick in the nuts is there is nothing we can do about it as it's the SQL module's fault, not the individual plugins using it. The SQL module needs to use persistent connections, so that each game server only keeps 1 connection alive and runs all it's queries through the one connection it has. Please support this feature request (http://bugs.alliedmods.net/index.php?do=details&task_id=1557) to get persistent connections in to AMXX.
Increasing the maximum number of connections won't solve much. It would just mean more resources are required.