:: DEVELOPER ZONE
When a new client connects to mysqld, mysqld spawns a new thread to handle the request. This thread first checks whether the hostname is in the hostname cache. If not, the thread attempts to resolve the hostname:
If the operating system supports the thread-safe
gethostbyaddr_r() and
gethostbyname_r() calls, the thread uses them to
perform hostname resolution.
If the operating system doesn't support the thread-safe calls, the
thread locks a mutex and calls gethostbyaddr()
and gethostbyname() instead. In this case, no
other thread can resolve hostnames that are not in the hostname
cache until the first thread unlocks the mutex.
You can disable DNS hostname lookups by starting
mysqld with the
--skip-name-resolve option. However, in this
case, you can use only IP numbers in the MySQL grant tables.
If you have a very slow DNS and many hosts, you can get more
performance by either disabling DNS lookups with
--skip-name-resolve or by increasing the
HOST_CACHE_SIZE define (default value: 128) and
recompiling mysqld.
You can disable the hostname cache by starting the server with the
--skip-host-cache option. To clear the hostname
cache, issue a FLUSH HOSTS statement or execute
the mysqladmin flush-hosts command.
If you want to disallow TCP/IP connections entirely, start
mysqld with the
--skip-networking option.
© 1995-2005 MySQL AB. All rights reserved.

User Comments
Warning: query failed: Unknown column 'user.firstname' in 'field list' in /data0/sites/live/web-main/lib/mysql-cxn.php on line 69
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data0/sites/live/web-main/lib/docbook.php on line 245
Add your own comment.