PDA

View Full Version : [ubuntu] speed up mysql server connection/query time



sa125
May 10th, 2009, 12:37 PM
I'm not sure if this question fits this forum, but I'll try.

I maintain a mysql database on one of our office servers (running ubuntu 8.10 server). The server's address is found on the network using its IP or DNS address.

The problem is that it takes between 5-10 seconds to connect to the server from another machine on the network (from the room next door), and about the same time to retrieve query results - even from tiny tables (6 rows..). I suspect this to be a network problem and not a query optimization issue, but I'm not sure how to work around it. We have another server in the office that's running dapper with the same mysql version, and its lightning fast.

This is probably something trivial, but I'd still appreciate any help on possible causes and how I might solve this problem. Thanks!

sa125
May 11th, 2009, 11:26 AM
if anyone happens to have the same problem, try editing your my.cnf file (typically under /etc/mysql/my.cnf, or try running "locate my.cnf" in bash).

Add skip-name-resolve in the [mysqld] section of the file and restart the service with /etc/init.d/mysql restart

hope this helps someone.

qhoore
November 28th, 2011, 09:34 AM
Thanks, it work even in 2011... great tip... :D