Jump to content

mysql_connect very slow on vlan intermittently


adm2007

Recommended Posts

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

 

Link to comment
Share on other sites

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>

 

 

......

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.