I have an app, which is normally running while our working hours. 8-12 hours.
This app is querying on user request, a few mySQL Server.
At nighttimes one Server may be doing backups of it’s Database and while this time, the Server allows to connect but takes ages to respond to such a connect request. Even while i am doing such connects in Threads, my app freezes.
How can i avoid such behavior please?
Configure the server so when its doing a backup it refuses connections outright
Then your app will try & fail right away
I’ve done that before with some database products so the server is literally “gone” when its not available and then a hot failover is used instead
Thank you Norman, but I’m afraid we can not. Because the server which makes me the most trouble, a system being tested by external systems for existence. Would the server completely reject connections, an unfortunate chain reaction would be triggered. There are backup systems, but if these should step in, it would cost a lot of money.
Unfortunately, I can not measure alone by PING times to detect whether the system is currently in a backup mode or not. So I’m looking for a way to reliably detect that the database requires too long for an SQL query, and then up to the user whether if to continue without this server, or whether the program should be terminated.
if its simply slow to respond because of network conditions vs slow to respond because a backup is in progress you really can’t tell
its just slow to respond in either case and you have no idea why
What if you setup replication to another server and did the backups on that machine? Should not see any performance hit on your production machine that way and in a worst case that your production machine went down you could have your app fail over to the backup.
Thank you Dwane. I would prefer it this way and will recommend this solution.