当网络有时候比较拥塞的时候,可能会高于这个数。
5.1.23 以前默认是5秒,以后默认是10秒,如果超过这个时间,服务器会记录: Lost connection to MySQL server at 'XXX', system error: errno.
3.skip-name-resolve
默认情况下mysql需要开启线程去请求客户端所用的域名,其中涉及到两个函数gethostbyaddr_r() and gethostbyname_r().通常这样会很慢,我们可以关闭mysqld不去反解dns。
如果关闭掉,grant授权这些都应该使用ip来定义。
{
The thread takes the IP address and resolves it to a host name (using gethostbyaddr()). It then takes that host name and resolves it back to the IP address (using gethostbyname()) and compares to ensure it is the original IP address.
If the operating system supports the thread-safe gethostbyaddr_r() and gethostbyname_r() calls, the thread uses them to perform host name resolution.
If the operating system does not support the thread-safe calls, the thread locks a mutex and calls gethostbyaddr() and gethostbyname() instead. In this case, no other thread can resolve host names that are not in the host name cache until the first thread unlocks the mutex.
You can disable DNS host name 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.
}