MySQL Forums
Forum List  »  General

Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11)
Posted by: Marek Slahor
Date: July 31, 2005 11:02AM

Hi gurus,

I have a linux (CentOS) server with 4GB RAM and dual opteron. It's handling all php/mysql operations easily under normal circuumstances but it has problem when there is too many hits within a second. I saw it on few ocasions when "free hits" server delivered few thousand hits within few seconds. It also happened when we ran a promotion on www.get-gifts-for-free.com and more than thousand people refreshed page when new gift became available. I guess it created more than 10000 hits too.

Settings of both apache and mysql are set to accept i think 1500 simultaneous connections. I tried to decrease and increase these values but it doesn't have any effect on the issue whatsoever.

The problem is that if there is too many hits, users get error. This is what I see in error log. I didn't find any explanation on any website.


[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/howitworks.php on line 7
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 83
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (11) in /home/getgifts/public_html/mysql.php on line 59
[Wed Jul 13 15:00:05 2005] [error] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/getgifts/public_html/mysql.php:59) in /home/getgifts/public_html/common.php on line 41



I have copied only "few" errors above because there is few hundred lines in logs.

PLEASE advice if you have any idea how to prevent this from happening again.

Thanks a million,
Marek

Options: ReplyQuote




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.