Bug #28836 --log-warnings=2 does not report max_connections limit reached
Submitted: 1 Jun 2007 13:33 Modified: 8 Jun 2007 7:51
Reporter: Yusuf Nulwala Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:mysqld Ver 5.0.26-log OS:Linux (suse-linux-gnu on x86_64 (SUSE MySQL RPM))
Assigned to: CPU Architecture:Any

[1 Jun 2007 13:33] Yusuf Nulwala
Description:
The documentation says :

"The --log-warnings option or log_warnings system variable can be used to control warning logging to the error log. The default value is enabled (1). Warning logging can be disabled using a value of 0. Aborted connections are not logged to the error log unless the value is greater than 1. See Section B.1.2.10, “Communication Errors and Aborted Connections”."

When max_connections are reached and the server refuses further connections there is no way to figure out until you get errors from MySQL.

ERROR
-----
" Warning: mysql_connect() [function.mysql-connect]: Host
'www.xyz.com' is blocked because of many
connection errors; unblock with 'mysqladmin flush-hosts' in
/web/domains/incl/extmod/adodb/drivers/adodb-mysql.inc.php on line 358 "

These are my variable settings.

max_connect_errors                10
max_connections                   100

How to repeat:
try to connect more than 100 users to MySQL with the same configuration

Suggested fix:
Logging should be enabled atleast when the max_connection limit is reached and how to handle refused connection requests
[4 Jun 2007 13:46] Yusuf Nulwala
Has cause us a lot of problem recently
[4 Jun 2007 13:48] Yusuf Nulwala
Tried every possible means but it does not log "error:1040 'too many connections' to the log file.
[5 Jun 2007 12:52] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read about in which cases Aborted connections messages appear in the error log at http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html
[8 Jun 2007 7:22] Yusuf Nulwala
Thanx for the reply.

My bug request was for logging max_connections reached message to the error log.

It has nothing to do with "Abort connections". 

If I as an admin set the "max_connections" variable value how do I come to know that when does the number of the connections exceeds the limit so that I can adjust the value of the variable or in case the load is really very high I can upgrade the hardware if the current hardware does have the capability to handle such loads.

Further another variable "max_connect_errors" which is set to 10 blocks the connection after 10 such failed connections. Hence I need to know which was the host who was refused connection before I use "mysqladmin flush-hosts" command.
I want the information logged to the error log.
[8 Jun 2007 7:51] Sveta Smirnova
Thank you for the feedback.

Reclassified as feature request.