adm2007 Posted September 12, 2007 Share Posted September 12, 2007 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 ten 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 10 seconds. Any ideas on how i might better diagnose the problem and fix it. at any time we may have about 150 concurrent users. please let me know what other info i should post to help diagnose the issue 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 Quote Link to comment https://forums.phpfreaks.com/topic/68996-mysql_connect-very-slow-on-vlan-intermittently/ Share on other sites More sharing options...
adm2007 Posted September 12, 2007 Author Share Posted September 12, 2007 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> ...... Quote Link to comment https://forums.phpfreaks.com/topic/68996-mysql_connect-very-slow-on-vlan-intermittently/#findComment-346823 Share on other sites More sharing options...
fenway Posted September 12, 2007 Share Posted September 12, 2007 If find it hard to believe that it's the connection as opposed to a query.... Quote Link to comment https://forums.phpfreaks.com/topic/68996-mysql_connect-very-slow-on-vlan-intermittently/#findComment-347061 Share on other sites More sharing options...
adm2007 Posted September 13, 2007 Author Share Posted September 13, 2007 well the script runs fine when connected to localhost so i think it must be the connection Quote Link to comment https://forums.phpfreaks.com/topic/68996-mysql_connect-very-slow-on-vlan-intermittently/#findComment-347632 Share on other sites More sharing options...
fenway Posted September 15, 2007 Share Posted September 15, 2007 And you're confident it's the mysql connection, not the connection itself? Quote Link to comment https://forums.phpfreaks.com/topic/68996-mysql_connect-very-slow-on-vlan-intermittently/#findComment-348829 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.