MySQL Forums
Forum List  »  Performance

mysql_connect very slow on vlan intermittently
Posted by: adrian murphy
Date: September 12, 2007 08:53AM

mysql 5.0.46-log
php 5.1.6

Hi I have a database server and a web server on a vlan.
Been getting reports that our site is intermittently very slow.
I did some apd profiling and found that every now and again a script that was
executing normally in well under a second was taking over 20 seconds.
On inspection it was mysql_connect that was sometimes very slow.one minute
it would take a fraction of a second and the next it would be 20 seconds.
when i run mysql on the same machine i dont see a problem.
please let me know what other info i should post to help diagnose the issue and fix it.

i use ip addresses rather than hostnames to connect so skip-name-resolve shouldn't be nessesary?

my.cnf

[mysqld]
server-id=1
log-bin
datadir=/home/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
max_connections = 500
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
default-character-set=latin1
#bind-address=192.168.1.10
[mysqld_safe]
err-log=/var/log/mysqld.log
open_files_limit = 8192
long_query_time=3
log-slow-queries=/var/log/slow-mysql.log
[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

[mysql.server]
user=mysql


httpd.conf :

ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 5
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 100
MaxClients 100
MaxRequestsPerChild 400
</IfModule>


......



Edited 1 time(s). Last edit at 09/12/2007 08:57AM by adrian murphy.

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql_connect very slow on vlan intermittently
5396
September 12, 2007 08:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.