summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2017-09-22 06:37:41 -0600
committerGitHub <noreply@github.com>2017-09-22 06:37:41 -0600
commit879d1837e74d987b23c337d98978f4311bc34222 (patch)
treea659590598fc2ca770edb45893ca218a54318b9e /src
parentb339f72fa544df8b297629c43d659f6777aacd18 (diff)
parent87b51a684f417869e88f3e81246b4197aefd6327 (diff)
downloadrabbitmq-server-git-879d1837e74d987b23c337d98978f4311bc34222.tar.gz
Merge pull request #1366 from rabbitmq/sync-rabbitmq-config-example-with-configure-page
Sync rabbitmq.config.example with PROJECT_ENV
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 de1fdbf962..d50490544c 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -178,12 +178,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
@@ -2384,6 +2384,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 ->