Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 VM's in the same machine, one running Apache, the other running MySQL.

When trying to connect from Apache to MySQL it takes 5 seconds for the console to come up.

When attempting to connect from Apache to an external MySQL, it works in less than 1/4 of a second.

How can I debug this? Could this be routing? I am accessing via IP, same network, same segment, etc.

How can I fix this?

share|improve this question

1 Answer 1

My money's on name resolution; the server's trying (and failing) to do a reverse DNS lookup on the private IP address that the connection's coming from.

Try the skip-name-resolve option.

share|improve this answer
    
Good suggestion... but it is already set... I also noticed the same latency with SSH access.. so it must be networking.. but not sure where... –  smorhaim Dec 5 '11 at 21:09
2  
@smorhaim SSH will exhibit the same issue with an IP that won't resolve to a name. Try adding an entry to the hosts file to circumvent and rule out name resolution issues. –  Shane Madden Dec 5 '11 at 21:17
    
The solution was adding an entry in the target machine hosts file as suggested :) post it as an answer, so I can mark it as the winner. thanks. –  smorhaim Dec 6 '11 at 1:25
3  
@smorhaim: the correct answer is the answer. the hosts suggestion in the comment is a hack but not a solution. –  Javier Dec 6 '11 at 4:12

Your Answer

 
discard

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.