Mysql Error, Can't Find Answer..

Frequently I get the following error when trying to access php pages using a mysql database:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/neverend/public_html/vars.php on line 22

This doesn't happen all the time, only about 5% of the time. I've tried a number of configs for my.cnf and no effect.

- I do have persistend connections turned off in php.ini.

- max_connections in my.cnf doesn't seem to have any effect on this error, with it there, removed, set high or low it still happens

- max_clients in httpd.conf set to 300, tried a few diffent configs, same result, not sure if this will effect it or not.

----

I've spent a LOT of time checking this and other forums for a definative solution/reason for this but can't seem to find one.

Server Specs: Dual Xeon 2.8 - 2GB RAM

The my.cnf file below seems to have the best effect on minimizing this from happening, if anybody has any suggestions on what setting could be causing this I'd appreciate it. Mysql Error, Can't Find Answer..


-----
[client]
#password = your_password
port = 3306
socket = /var/tmp/mysql.sock
[mysqld]
skip-locking
key_buffer = 150M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 1M
read_buffer_size = 1M
thread_cache_size=128
myisam_sort_buffer_size = 64M
thread_cache = 8
thread_concurrency = 8
skip-innodb
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
set-variable = max_connections=500
set-variable = interactive_timeout=60
set-variable = wait_timeout=60
set-variable = connect_timeout=60
log-bin
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

---

The above setting seems to be the best and it works well except when the mysql server has been running a day or two and the RSS (in 'top') for the mysql processes get up to 233M each and then the errors seem to happen more frequently.

Thanks for any suggestions in advance.

 

 

 

 

Top