Mysql optimization -- skip-name-resolve

Source: Internet
Author: User
Tags ip number

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.