I have a client app that constantly pings server with mysql_ping(). This is happening in intervals of every 1-5 seconds, how costly would this be if plenty of users use the app?
The reason i am doing it is to avoid MySQL reconnection-delay and unless there is something going on between client and server every 1-5-10 seconds(not sure) then reconnection is required and it doesn’t help me at all.
edit: This is not web-app but local software so by client app(machine) i am talking about application users who need to constantly ping server
If the clients are different physical machines, then ping may (and I stress the may) be a good idea.
By avoiding the reconnection you certainly speed things up.
The main drawback is the number of users – MySQL has a limit to users, and if each one of them is always connected you may hit that limit.
If you don’t hit the limit I see no harm in it.
As far as network usage a ping is quite minimal. Certainly if this is a local LAN (not over the internet) there is no harm there.