mysql-proxy-discuss team mailing list archive
-
mysql-proxy-discuss team
-
Mailing list archive
-
Message #00012
Re: New option --max-open-files
On Jan 18, 2009, at 5:05 PM, Joshua Zhu wrote:
Hi Kay,
It seems that the flow of max-open-file option processing in your last
commit was like this (non WIN32 systems, in pseudo code):
if the max-open-file-option is not set then
set the-limit-of-open-files = 8192
else
set the-limit-of-open-files = the-number-specified
end
But I think it might be better if the flow is:
if the max-open-file-option is set then
set the-limit-of-open-files = the-number-specified
end
Because IMHO, it should be okay if a user sets the max number of open
files by using the ulimit(1) command but without setting the
max-open-file option, no matter the number is greater than or less
than 8192.
In a word, we should only reset the value of RLIMIT_NOFILE when the
max-open-file option is specified clearly.
In general I'd agree but this is one the ugly things that come up with
us using the same code in the MySQL Enterprise Monitor:
Basically, we have customers who did not increase the max number of
open files prior to starting the agent, and later on ran out of fds.
We wanted to have a solution that would set a "reasonable" default
value, but for Windows I could not come up with a solution that
increased the number in a script.
So, rather than doing the ulimit in a wrapper script and using a
different approach for Windows, I've opted to do it in C for all
platforms.
We chose 8192 simply because it's a nice enough and high enough
number ;)
Perhaps this needs a bit more documentation, I'll raise the issue with
our docs folks.
To reiterate: Some folks simply forget to raise ulimit -n, then run
into problems in production, which we need to avoid. 8192 is
reasonable, and you can still set it to whatever you want.
Perhaps the code should check if the current number is higher than
8192 and not mess with it. Good idea, actually.
cheers,
-k
--
Kay Roepke
Software Engineer, MySQL Enterprise Tools
Sun Microsystems GmbH Sonnenallee 1, DE-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer: Thomas Schroeder, Wolfang Engels, Dr. Roland Boemer
Vorsitz d. Aufs.rat.: Martin Haering HRB MUC 161028
Follow ups
References