Web Application Works Faster With IP Address

Hi Experts,

I am running a PHP MySQL application on Windows 2012 IIS, but it was extremely slow. Changing my db host from localhost:3306 to 127.0.0.1:3306 seem to do the trick. Any idea why?

The hosting company telling me that it is because the DNS lookup, but there is a difference of 7s. Could a DNS lookup take that long?
APD TorontoAsked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
On the other hand... 'localhost' on that machine may resolve initially to the '::1' IPv6 address.  If the MySQL server does not respond to the IPv6 address immediately, that could explain the delay.
1
 
Dave BaldwinFixer of ProblemsCommented:
Well that's probably bullshit.  Neither one of those addresses will go thru DNS.  As far as I know...
0
 
APD TorontoAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.