Friday, October 30, 2009

Slow MySQL Remote Connection

If your application is connecting very slow to a remote MySQL database you might want to try adding this line to the my.ini file of the server:

skip-name-resolve

Basically, when a new client connects to MySQL, it spawns a new thread to handle the request. This thread first checks whether the host name is in the host name cache. If not, the thread attempts to resolve the host name. This may take a lot of time to finish so to ignore this process we add the above line to my.ini file.

Please see MySQL documentation for further explanation.

0 comments:

Post a Comment