summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-08-13 12:44:49 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-08-13 12:44:49 +0100
commit3593af16fc012d2cef846cc6a524288030d3c267 (patch)
treea5b97bda0f5aab38613fbe128018fd4d4c181daa
parentd7403064c32277006954c82d2681fce9d6d46faa (diff)
downloadrabbitmq-server-bug23118.tar.gz
Improvements to commentsbug23118
-rw-r--r--src/file_handle_cache.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 4ef5e29f..5b348580 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -137,6 +137,13 @@
-define(SERVER, ?MODULE).
-define(RESERVED_FOR_OTHERS, 100).
+
+%% Googling around suggests that Windows has a limit somewhere around
+%% 16M, eg
+%% http://blogs.technet.com/markrussinovich/archive/2009/09/29/3283844.aspx
+%% however, it turns out that's only available through the win32
+%% API. Via the C Runtime, we have just 512:
+%% http://msdn.microsoft.com/en-us/library/6e3b887c%28VS.80%29.aspx
-define(FILE_HANDLES_LIMIT_WINDOWS, 512).
-define(FILE_HANDLES_LIMIT_OTHER, 1024).
-define(FILE_HANDLES_CHECK_INTERVAL, 2000).
@@ -820,12 +827,9 @@ maybe_reduce(State = #fhc_state { limit = Limit, count = Count, elders = Elders,
maybe_reduce(State) ->
State.
-%% Googling around suggests that Windows has a limit somewhere around
-%% 16M, eg
-%% http://blogs.technet.com/markrussinovich/archive/2009/09/29/3283844.aspx
-%% For everything else, assume ulimit exists. Further googling
-%% suggests that BSDs (incl OS X), solaris and linux all agree that
-%% ulimit -n is file handles
+%% For all unices, assume ulimit exists. Further googling suggests
+%% that BSDs (incl OS X), solaris and linux all agree that ulimit -n
+%% is file handles
ulimit() ->
case os:type() of
{win32, _OsName} ->