Improve haproxy mysql logic