Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So we have 2 servers all running at the same web host. We have bind MySQL to listen on the public ip-address of the database server and the web server connects to it from the public ip. Both servers run on the same private network.

Currently, the DB connect method from our php script takes about 3ms to connect to the MySQL database server host.

My question is, would MySql data interaction from the web server be faster if we bind it to listen on the private lan address on the database server instead of the public IP? or is it the same regardless and it wont make a different.

share|improve this question
Do you know what the network looks like in between the systems for the public vs private network - differences in switching, routing, etc? If not, then it might be a situation where you'll just need to test each option to see which is faster. And by the way, if you're binding MySQL to a publicly accessible interface, make sure that it's firewalled so that only certain IP addresses can connect. – Shane Madden Oct 14 '12 at 8:16
it looks like your mysql server tries to resolve connecting client add skip-name-resolve to mysqld section of your my.cnf and restart mysql service – zb' Oct 14 '12 at 8:17
@eicto I tried the skip-name-resolve and that works as expected but we still cant make mysql start once the bind address port is set to the local ip – Lamin Barrow Oct 14 '12 at 11:31

Packets to the public ip most likely travel through your firewall, and packets to the private ip most likely don't. So yes, it will probably be (slightly) faster to use the private ip.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.