c++ - Is having a active MySQL Connection for long periods of time bad? -
I am developing an MMORPG, it is quite far away.
However, now I see that the MySQL server has an automatic connection timeout. So after X time, a connection has ended. So what is happening with my server, after the run time of 8 hours, users can not login at logout or update their letters.
The value of an easy fixed time is to be enormous, but I want to know that this is a bad idea?
Another solution would be to check whether the connection is still valid before creating a SQL query, and do not start a new connection even though I prefer the first option if it has any No side effects.
If you are not already doing that I would like to say that the best option is to have a connection Instead of reusing it to be fair use on the server.
Now, should be secured in timeout, but the MySQL memory leak (of type) that is tied to the connection, it can be safer to leave the connection periodically . For example, if you are generating dynamically questions (some APIs do to protect queries from SQL injection attacks), then Msolil may have trouble caching all the prepared questions in the memory.
Unfortunately you may have to apply such removal.
Comments
Post a Comment