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

I'm having a mysql connection speed issue with my home development setup. I have two VM's (VirtualBox running on a Ubuntu host). One is my WEBSERV with apache2/php and one is by DBSERV with mysql and postgres (both are ubuntu server 10.4 LTS). Also, i have mysql installed on the WEBSERV as well and this was only done before i decided to have a separate database VM. When querying a simple table from the WEBSERV mysql via a php webpage is runs very fast ( < 1sec) -- just like it should. However, when i run the same simple query but against the separate DBSERV mysql via a php webpage it works but it takes + 5 seconds to return a request. It's not like it doesn't work -- it just takes way too long.

At first i thought it was a network issue but the pinging the DBSERV from the WEBSERV take 1-2ms. And to further test, when i run the same simple query from WEBSERV via a php webpage querying postgres on DBSERV it is very fast -- just like it should be.

So, it looks like it is some sort of setting either with apache/php on WEBSERV or with mysql on DBSERV. I'm at a loss as to what settings/setup i need to modify. It would be one thing if the slow request just didn't work at all -- but it does... it's just extremely slow and i can't figure out why that is the case.

Anyone point me in a direction on settings to check?!?


share|improve this question

migrated from Oct 27 '10 at 11:37

This question came from our site for professional and enthusiast programmers.

Found the issue -- add the 'skip-name-resolve' to the my.cnf file on DBSERV and that fixed the delay. Found it on serverfault (… ) – Michael Oct 26 '10 at 21:47
Why dinn't you answer your own question so you can close it? – quamis Nov 11 '10 at 8:36

If you're getting 5 second delays, you may want to add skip-name-resolve to the my.cnf file. That will prevent it from doing a lookup on your IP, and possibly timing out.

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.