summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2017-09-22 14:40:53 +0200
committerMichael Klishin <michael@clojurewerkz.org>2017-09-22 14:40:53 +0200
commit2fd5c7e9f21011e61117282807247b7cf074f474 (patch)
treed503bb72ad76014beda6e0afb4b9ea6a90a522ec /src
parent3aeb47f7f0fd5c9b83202cf89f230e7210014184 (diff)
parent879d1837e74d987b23c337d98978f4311bc34222 (diff)
downloadrabbitmq-server-git-2fd5c7e9f21011e61117282807247b7cf074f474.tar.gz
Merge branch 'stable'
Conflicts: docs/rabbitmq.config.example
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 4d61bb4b03..ac3d60bb11 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -189,12 +189,12 @@
%% (betas+gammas+delta)/(target_ram_count+betas+gammas+delta). I.e. as
%% the target_ram_count shrinks to 0, so must betas and gammas.
%%
-%% The conversion of betas to gammas is done in batches of at least
-%% ?IO_BATCH_SIZE. This value should not be too small, otherwise the
-%% frequent operations on the queues of q2 and q3 will not be
-%% effectively amortised (switching the direction of queue access
-%% defeats amortisation). Note that there is a natural upper bound due
-%% to credit_flow limits on the alpha to beta conversion.
+%% The conversion of betas to deltas is done if there are at least
+%% ?IO_BATCH_SIZE betas in q2 & q3. This value should not be too small,
+%% otherwise the frequent operations on the queues of q2 and q3 will not be
+%% effectively amortised (switching the direction of queue access defeats
+%% amortisation). Note that there is a natural upper bound due to credit_flow
+%% limits on the alpha to beta conversion.
%%
%% The conversion from alphas to betas is chunked due to the
%% credit_flow limits of the msg_store. This further smooths the
@@ -2428,6 +2428,9 @@ reduce_memory_use(State = #vqstate {
end,
State3 =
+ %% If there are more messages with their queue position held in RAM,
+ %% a.k.a. betas, in Q2 & Q3 than IoBatchSize,
+ %% write their queue position to disk, a.k.a. push_betas_to_deltas
case chunk_size(?QUEUE:len(Q2) + ?QUEUE:len(Q3),
permitted_beta_count(State1)) of
S2 when S2 >= IoBatchSize ->