Tigase reconnects only connections which tries to use, so if 10 connections are broken, but needs only 2 for current operation then only this 2 will reconnect at this point. Next will reconnect when needed.
Eric Dziewa commented 9 years ago
I logged in 75,000 users to the server within 5 minutes. I don't think 2 connections are enough for that.
Correction 90,000 users attempted. I think about 20,000 were able to login.
Artur Hefczyc commented 9 years ago
The CLOSE_WAIT issue might be related to the DB driver we use. So it can be different for different DBs and even different between driver versions. I guess, for some drivers the CLOSE_WAIT may be cleared out only after GC run.
In any case we have to investigate it.
If the Tigase reopens only 2 DB connections, even under a high load it may mean that DB code does not make a proper use of concurrency. Or maybe DB response is fast enough and the load is not high enough.
It seems that Tigase never closes the socket when the db connection is cut. Then it doesn't start enough connections to recover.
Start Tigase
Restart MySQL
Start Load
CLOSE_WAIT means your program is still running, and hasn't closed the socket (and the kernel is waiting for it to do so).
There are now 10,000 connections on port 5222. I try to login to tigase but can't Connection reset by peer, Server closed the connection.
The CLOSE_WAIT state never goes away.