diff options
| author | Marek Majkowski <majek@lshift.net> | 2009-10-07 16:27:41 +0100 |
|---|---|---|
| committer | Marek Majkowski <majek@lshift.net> | 2009-10-07 16:27:41 +0100 |
| commit | e7c22ad29957e2d217f80b3b0b57c2506683a2cf (patch) | |
| tree | b3dd2ff88fbac2028f2aa17924dc75a2f191c9db | |
| parent | b2b1590fb3a2699a21404798a5d66e4866134d1a (diff) | |
| download | rabbitmq-server-git-e7c22ad29957e2d217f80b3b0b57c2506683a2cf.tar.gz | |
Few more lines of comments
| -rw-r--r-- | src/rabbit_memory_monitor.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl index 8bdd394bc7..ebbae94ab0 100644 --- a/src/rabbit_memory_monitor.erl +++ b/src/rabbit_memory_monitor.erl @@ -53,6 +53,20 @@ %% update we notice that a queue was using too much memory, we send a message %% back. This will happen even if the queue is hibernated, as we really do want %% it to reduce its memory footprint. +%% +%% +%% The main job of this module, is to make sure that all the queues have +%% more or less the same number of seconds till become drained. +%% This average, seconds-till-queue-is-drained, is then multiplied by +%% the ratio of Used/Total memory. So, if we can 'afford' more memory to be +%% used, we'll report greater number back to the queues. In the out of +%% memory case, we are going to reduce the average drain-seconds. +%% To acheive all this we need to accumulate the information from every +%% queue, and count an average from that. +%% +%% real_drain_avg = avg([drain_from_queue_1, queue_2, queue_3, ...]) +%% memory_overcommit = used_memory / allowed_memory +%% desired_drain_avg = memory_overcommit * real_drain_avg -module(rabbit_memory_monitor). |
