Not the answer you need?
Register and ask your own question!

DNS Resolution / IP Address showing in process list

iberkneriberkner ContributorInactive User Role Advisor
Hi,

We have a basic master ==> slave configuration, with the slave being used for read only purposes.

There are 5 systems in our application pool accessing the data, including the slave itself (we are using it as an application server).

We recently found out that one of our systems was not in the hosts file of the database systems and this was causing delays with MySQL due to DNS issues. This was resolved.

I am not looking at the process list of the slave, which is also acting as an application server (i.e. reading data). I noticed in the process list that the slave's IP address of 192.168.1.226 is showing instead of its resolved DNS name. In fact, in looking at our host file on this system, I see:

127.0.0.1 dbslave.ourdomain.com db2 localhost.localdomain localhost
192.168.1.2 app2 app2.ourdomain.com
192.168.1.3 app3 app3.ourdomain.com
192.168.1.1 dbmaster dbmaster.ourdomain.com
192.168.1.4 app4 app4.ourdomain.com
192.168.1.5 app5 app5.ourdomain.com

The IP address of the DB Slave on the network is 192.168.1.226, this is the IP address that is showing up in the processlist:

| 3030806 | ro_user | 192.168.1.226:39557

Is this an issue? Meaning, should we see:

| 3030806 | ro_user | dbslave:39557

I tried modifying the hosts file but that didn't seem to have an effect on it. Does the mysql service need to be restarted in order for host resolution to be updated?

Thanks!

Comments

  • iberkneriberkner Contributor Inactive User Role Advisor
    I just realized that I didn't do a "flush hosts" command which is why the IP address in the hosts file wasn't resolving. I'd be curious to still understand if this is an issue?

    Thanks
  • przemekprzemek Percona Support Engineer Percona Staff Role
    IMHO allowing the MySQL server to do DNS lookups is asking for trouble and is also a source of unnecessary speed overhead. Web applications aim is to return answer ASAP, so why to loose more miliseconds on DNS queries ?

    And if for any reason DNS server becomes slow or unavailable then it affects your database as well.

    So I recommend this option:
    http://dev.mysql.com/doc/refman/5.1/en/server-options.html#o ption_mysqld_skip-name-resolve
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.