MySQL and DNS woes?

A quick solution to a common problem: your MySQL server has thousands of connections, some or most are not persistent. Unless you say otherwise, MySQL will check connections hostnames against the system DNS server. While this is generally not a problem with low traffic, when you are dealing with many concurrent connections you are not only wasting cycles with DNS name resolve, you may also overwhelm or alert your DNS server/provider. The solution? Set skip-name-resolve in the my.cnf file and MySQL will run the connections off of their IP address instead of the DNS name that it resolves to.  

3 thoughts on “MySQL and DNS woes?

  1. mike says:

    This is curious. I came to ask “don’t you mean skip-name-resolv” and a quick Google shows a few people referencing that.

    However I just grepped the source for 5.0.67 and I see nothing that matches “skip-name-resolv” only matchings for “skip-name-resolve” – so I think that is incorrect (I would assume so since I’ve had “skip-name-resolve in my my.cnf’s forever and it is spelled correctly as well)

    :)

  2. admin says:

    Good observation, in haste I left out the “e”. In my standard cnf files ( http://themattreid.com/wordpress/?p=5 and included in Monolith Toolkit http://code.google.com/p/monolith-toolkit/ ) I have it listed as skip-name-resolve

    :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>