+44 (0) 845 260 0726

Pixl8

You are:

  • | Share

Slow MySQL Server connections

Alex Skinner   Posted: 05 January 2007

We had a problem recently with slow connections to a MySQL 5 database on linux. The symptoms were that for the first connection from the client (cfmx /bluedragon/query tool) the response from the MySQL server would be very slow up to 15secs. Then after that the reponse was quick (This was actually a bit random under load with connection pooling).

It turns out that if you experience slow connections its likely that your MySQL server is trying to do a reverse DNS lookup against the client and does not have access to a DNS server.

Now there is an option that can be set for MySQL --skip-name-resolve which will solve this if you cannot give it a DNS Server but for me adding a local DNS fixed the issue (Make sure you restart MySQL for it to pick it up though)

The MySQL command

show processlist

Is invaluable in diagnosing these issues as it'll show current connections, it's similar to the SQL server equivalent

sp_who
  1. Bookmark & Share :
  2. Delicious
  3. Digg
  4. Facebook
  1. Comments (0)
  2. 635 Views