Check MySQL connection using ping

On high-load Ruby-on-Rails sites there are a number of app servers to help scaling issues. MySQL's stat method to quite resource hungry and can overload the server when there are multiple app servers. MySQL's ping is a much better approach.