Mysql optimization -- skip-name-resolve
In the same IDC, the IDC has DNS servers and reverse resolution is performed on the IP addresses of each server, but no reverse resolution is performed on the Intranet IP addresses, therefore, after skip-name-resolve is used, an Intranet address is used to send a request to mysqlslap, which is half faster. The parameters -- skip-name-resolve, -- skip-host-cache are involved, -- skip-networking when a new customer connects to mysqld, mysqld creates a new thread to process requests. This thread first checks whether the host name is in the host name cache. If not, the thread tries to parse the Host Name: If the operating system supports thread-safe call of gethostbyaddr_r () and gethostbyname_r (), the thread uses them to perform host name resolution. If the operating system does not support thread-safe calling, the thread locks a mutex and calls gethostbyaddr () and gethostbyname (). In this case, no other threads can resolve the host names that are not in the host name cache before the 1st threads unlock the mutex. You can use the -- skip-name-resolve option to start mysqld to disable DNS host name search. However, in this case, you can only use the IP number in the MySQL authorization table. If you have a very slow DNS and many hosts, you can disable DNS lookup by using -- skip-name-resolve or add the HOST_CACHE_SIZE definition (default: 128) and re-compile mysqld to improve performance. You can use the -- skip-host-cache option to enable the server to disable the host name cache. To clear the host name cache, run the flush hosts statement or the mysqladmin flush-hosts command. If you want to completely disable TCP/IP connections, use the -- skip-networking option to start mysqld. During connection to mysql, reverse address query will be performed to DNS. Only when timeout fails will mysql respond to the status of all mysql processes waiting for resolution on the client.