Mysql优化--skip-name-resolve_MySQL
同一IDC ,IDC内部有DNS服务器,对各服务器的IP做了反向解析,但未对内网IP做反向解析,所以使用skip-name-resolve以后用内网地址向mysqlslap请求响应快了一半
涉及参数 --skip-name-resolve ,--skip-host-cache ,--skip-networking
当新的客户连接mysqld时,mysqld创建一个新的线程来处理请求。该线程先检查是否主机名在主机名缓存中。如果不在,线程试图解析主机名:
如果操作系统支持线程安全gethostbyaddr_r ()和gethostbyname_r()调用,线程使用它们来执行主机名解析。
如果操作系统不支持线程安全调用,线程锁定一个互斥体并调用gethostbyaddr()和gethostbyname()。在这种情况下,在第1个线程解锁互斥体前,没有其它线程可以解析不在主机名缓存中的主机名。
你可以用--skip-name-resolve选项启动mysqld来禁用DNS主机名查找。然而,在这种情况下,你只可以使用MySQL中的授权表中的IP号。
如果你有一个很慢的DNS和许多主机,你可以通过用--skip-name-resolve禁用DNS查找或增加HOST_CACHE_SIZE定义(默认值:128)并重新编译mysqld来提高性能。
你可以用--skip-host-cache选项启动服务器来禁用主机名缓存。要想清除主机名缓存,执行FLUSH HOSTS语句或执行mysqladmin flush-hosts命令。
如果你想要完全禁止TCP/IP连接,用--skip-networking选项启动mysqld。
连接mysql时,都会向DNS做反向地址查询
只有等超时失败后,mysql才会响应客户端
等待解析的mysql进程都是 login状态
以上就是Mysql优化--skip-name-resolve_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to improve performance by optimizing the AVG function in MySQL MySQL is a popular relational database management system that contains many powerful functions and functions. The AVG function is widely used in calculating averages, but because this function needs to traverse the entire data set, it will cause performance problems in the case of large-scale data. This article will introduce in detail how to optimize the AVG function through MySQL to improve performance. 1. Using indexes Indexes are the most important part of MySQL optimization.

MySQL optimization based on TokuDB engine: improving writing and compression performance Introduction: As a commonly used relational database management system, MySQL is facing increasing writing pressure and storage requirements in the context of the big data era. To meet this challenge, TokuDB engine came into being. This article will introduce how to use the TokuDB engine to improve MySQL's writing performance and compression performance. 1. What is TokuDB engine? TokuDB engine is a big data-oriented engine designed to handle high write

MySQL is a widely used relational database management system commonly used for web application development and data storage. In practical applications, the underlying optimization of MySQL is particularly important, among which the advanced optimization of SQL statements is the key to improving database performance. This article will introduce some tips and best practices for implementing MySQL's underlying optimization, as well as specific code examples. Determine the query conditions When writing SQL statements, you must first clearly define the query conditions and avoid using unlimited wildcard queries, that is, avoid using "%" to open the query.

MySQL is a relational database management system widely used in the field of e-commerce. In e-commerce applications, it is crucial to optimize and secure MySQL. This article will analyze MySQL’s optimization and security project experience in e-commerce applications. 1. Performance optimization database architecture design: In e-commerce applications, database design is the key. Reasonable table structure design and index design can improve the query performance of the database. At the same time, using table splitting and partitioning technology can reduce the amount of data in a single table and improve query efficiency.

How to optimize MySQL connection number management MySQL is a popular relational database management system that is widely used in various websites and applications. In the actual application process, MySQL connection number management is a very important issue, especially in high concurrency situations. Reasonable management of the number of connections can improve the performance and stability of the system. This article will introduce how to optimize MySQL connection number management, including detailed code examples. 1. Understand connection number management In MySQL, the number of connections refers to the number of connections that the system can connect at the same time.

MySQL database is a common relational database. As the amount of data in the database increases and query requirements change, underlying optimization becomes particularly important. In the process of underlying optimization of MySQL, SQL statement optimization is a crucial task. This article will discuss common techniques and principles for SQL statement optimization and provide specific code examples. First of all, SQL statement optimization needs to consider the following aspects: index optimization, query statement optimization, stored procedure and trigger optimization, etc. In these aspects, we will have

How to properly configure and optimize MySQL's double-write buffering technology Introduction: MySQL's double-write buffering technology is an important technology that improves data security and performance. This article will introduce how to properly configure and optimize MySQL's double-write buffering technology to better protect data and improve database performance. 1. What is double-write buffering technology? Double-write buffering technology is an I/O optimization technology of MySQL. It can significantly reduce the number of disk I/O operations and improve the write performance of the database. When MySQL performs a write operation, first

Optimizing MySQL query performance: Comprehensive techniques from storage engines to query statements Summary: MySQL is a widely used open source relational database management system and the database of choice for many applications. However, as data volume increases and query load increases, query performance can become an issue. This article will introduce a series of optimization techniques, from storage engine selection to query statement optimization, to help improve MySQL query performance. Use the appropriate storage engine MySQL provides a variety of storage engines, such as M
