MySQL remote access slow resolution and analysis

Source: Internet
Author: User

Environment Introduction:
os:rhel5.4
mysql:5.5.10
Exception Scenario:
database has been in the computer room intranet access and use, a day a foreign node needs to access the database, access rights, they feedback is very slow;
immediately on the fire wall, opened their own company IP access, there are similar problems!
Start Troubleshooting Reason:
1. Check that the network is stable? Get the answer, ping ttl value is stable, ssh is normal;
2. Check MySQL running status, no abnormal discovery;
3. Suddenly think of, MySQL use DNS to do parsing parameters may be in the planning, did not set!!!
Workaround:
1. Validation parameters
mysql> Show variables like ' skip_% ';
+-----------------------+-------+
| variable_name | Value |
+-----------------------+-------+
| skip_external_locking | On |
| skip_name_resolve | OFF |
| skip_networking | OFF |
| skip_show_database | OFF |
+-----------------------+-------+
4 rows in Set (0.00 sec)
mysql> Show variables like ' skip_% ';
2. Stop the library, modify the parameters inside the my.cnf
[Mysqld]
Skip_name_resolve
3. After restarting the database, verify that:
mysql> Show variables like ' skip_% ';
+-----------------------+-------+
| variable_name | Value |
+-----------------------+-------+
| skip_external_locking | On |
| skip_name_resolve | On |
| skip_networking | OFF |
| skip_show_database | OFF |
+-----------------------+-------+
4 rows in Set (0.03 sec)
This option disables DNS resolution, and the connection speed is much faster. However, it is not possible to use the hostname in the MySQL authorization table and only use the IP address.


reference point of Knowledge collation:
mysqld parameter Finishing http://dev.mysql.com/doc/refman/5.5/en/mysqld-option-tables.html
skip-name-resolve Parameter Introduction 1:http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_skip-name-resolve
Skip-name-resolve Parameter Introduction 2:http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_skip_ Name_resolve
host-cache parameter Description: http://dev.mysql.com/doc/refman/5.5/en/host-cache.html
Another way: Add the host_cache_size definition in source code (default: 128) and recompile mysqld to improve performance {temporarily not tested}

MySQL remote access slow resolution and analysis

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.