Skip to content

Commit 879d183

Browse files
Merge pull request #1366 from rabbitmq/sync-rabbitmq-config-example-with-configure-page
Sync rabbitmq.config.example with PROJECT_ENV
2 parents b339f72 + 87b51a6 commit 879d183

File tree

2 files changed

+160
-36
lines changed

2 files changed

+160
-36
lines changed

docs/rabbitmq.config.example

Lines changed: 151 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,21 @@
3838
%%
3939
%% {handshake_timeout, 10000},
4040

41-
%% Log levels (currently just used for connection logging).
42-
%% One of 'debug', 'info', 'warning', 'error' or 'none', in decreasing
43-
%% order of verbosity. Defaults to 'info'.
41+
%% Log levels in decreasing order of verbosity:
42+
%% * 'debug'
43+
%% * 'info'
44+
%% * 'warning'
45+
%% * 'error'
46+
%% * 'none'
47+
%% Defaults to '{connection, info}'
4448
%%
45-
%% {log_levels, [{connection, info}, {channel, info}]},
49+
%% {log_levels, [{channel, info}, {connection, info}, {federation, info}, {mirroring, info}]},
4650

4751
%% Set to 'true' to perform reverse DNS lookups when accepting a
4852
%% connection. Hostnames will then be shown instead of IP addresses
4953
%% in rabbitmqctl and the management plugin.
5054
%%
51-
%% {reverse_dns_lookups, true},
55+
%% {reverse_dns_lookups, false},
5256

5357
%%
5458
%% Security / AAA
@@ -120,12 +124,17 @@
120124
%%
121125
%% To use the SSL cert's CN instead of its DN as the username
122126
%%
123-
%% {ssl_cert_login_from, common_name},
127+
%% {ssl_cert_login_from, distinguished_name},
124128

125129
%% SSL handshake timeout, in milliseconds.
126130
%%
127131
%% {ssl_handshake_timeout, 5000},
128132

133+
%% Makes RabbitMQ accept SSLv3 client connections by default.
134+
%% DO NOT DO THIS IF YOU CAN HELP IT.
135+
%%
136+
%% {ssl_allow_poodle_attack, false},
137+
129138
%% Password hashing implementation. Will only affect newly
130139
%% created users. To recalculate hash for an existing user
131140
%% it's necessary to update her password.
@@ -180,7 +189,10 @@
180189
%% =====================================================
181190
%%
182191

183-
%% Set the default AMQP heartbeat delay (in seconds).
192+
%% Sets the default AMQP 0-9-1 heartbeat timeout in seconds.
193+
%% Values lower than 6 can produce false positives and are not
194+
%% recommended.
195+
%% See http://www.rabbitmq.com/heartbeats.html.
184196
%%
185197
%% {heartbeat, 60},
186198

@@ -196,12 +208,11 @@
196208
%% Set the max permissible number of channels per connection.
197209
%% 0 means "no limit".
198210
%%
199-
%% {channel_max, 128},
211+
%% {channel_max, 0},
200212

201-
%% Customising Socket Options.
213+
%% TCP socket options.
202214
%%
203-
%% See (http://www.erlang.org/doc/man/inet.html#setopts-2) for
204-
%% further documentation.
215+
%% See http://www.rabbitmq.com/networking.html.
205216
%%
206217
%% {tcp_listen_options, [{backlog, 128},
207218
%% {nodelay, true},
@@ -288,19 +299,40 @@
288299
%% NB: Change these only if you understand what you are doing!
289300
%%
290301

291-
%% To announce custom properties to clients on connection:
302+
%% Queue master location strategy:
303+
%% * <<"min-masters">>
304+
%% * <<"client-local">>
305+
%% * <<"random">>
306+
%% See https://www.rabbitmq.com/ha.html#queue-master-location
307+
%%
308+
%% {queue_master_locator, <<"client-local">>},
309+
310+
%% Batch size (number of messages) used during eager queue mirror synchronisation.
311+
%% See https://www.rabbitmq.com/ha.html#batch-sync. When average message size is relatively large
312+
%% (say, 10s of kilobytes or greater), reducing this value will decrease peak amount
313+
%% of RAM used by newly joining nodes that need eager synchronisation.
314+
%%
315+
%% {mirroring_sync_batch_size, 4096},
316+
317+
%% Enables flow control between queue mirrors.
318+
%% Disabling this can be dangerous and is not recommended.
319+
%% When flow control is disablied, queue masters can outpace mirrors and not allow mirrors to catch up.
320+
%% Mirrors will end up using increasingly more RAM, eventually triggering a memory alarm.
321+
%%
322+
%% {mirroring_flow_control, true},
323+
324+
%% Additional server properties to announce to connecting clients.
292325
%%
293326
%% {server_properties, []},
294327

295328
%% How to respond to cluster partitions.
296-
%% See http://www.rabbitmq.com/partitions.html for further details.
329+
%% See http://www.rabbitmq.com/partitions.html
297330
%%
298331
%% {cluster_partition_handling, ignore},
299332

300333
%% Make clustering happen *automatically* at startup - only applied
301334
%% to nodes that have just been reset or started for the first time.
302-
%% See http://www.rabbitmq.com/clustering.html#auto-config for
303-
%% further details.
335+
%% See http://www.rabbitmq.com/clustering.html#auto-config
304336
%%
305337
%% {cluster_nodes, {['[email protected]'], disc}},
306338

@@ -319,32 +351,115 @@
319351
%%
320352
%% {collect_statistics_interval, 5000},
321353

322-
%% Explicitly enable/disable hipe compilation.
354+
%% Enables vhosts tracing.
323355
%%
324-
%% {hipe_compile, true},
356+
%% {trace_vhosts, []},
325357

326-
%% Number of times to retry while waiting for Mnesia tables in a cluster to
327-
%% become available.
358+
%% Explicitly enable/disable HiPE compilation.
359+
%%
360+
%% {hipe_compile, false},
361+
362+
%% Number of delegate processes to use for intra-cluster communication.
363+
%% On a node which is part of cluster, has more than 16 cores and plenty of network bandwidth,
364+
%% it may make sense to increase this value.
365+
%%
366+
%% {delegate_count, 16},
367+
368+
%% Number of times to retry while waiting for internal database tables (Mnesia tables) to sync
369+
%% from a peer. In deployments where nodes can take a long time to boot, this value
370+
%% may need increasing.
328371
%%
329372
%% {mnesia_table_loading_retry_limit, 10},
330373

331-
%% Time to wait per retry for Mnesia tables in a cluster to become
332-
%% available.
374+
%% Amount of time in milliseconds which this node will wait for internal database tables (Mnesia tables) to sync
375+
%% from a peer. In deployments where nodes can take a long time to boot, this value
376+
%% may need increasing.
333377
%%
334378
%% {mnesia_table_loading_retry_timeout, 30000},
335379

336-
%% Size in bytes below which to embed messages in the queue index. See
337-
%% http://www.rabbitmq.com/persistence-conf.html
380+
%% Size in bytes below which to embed messages in the queue index.
381+
%% See http://www.rabbitmq.com/persistence-conf.html
338382
%%
339383
%% {queue_index_embed_msgs_below, 4096},
340384

385+
%% Maximum number of queue index entries to keep in journal
386+
%% See http://www.rabbitmq.com/persistence-conf.html.
387+
%%
388+
%% {queue_index_max_journal_entries, 32768},
389+
390+
%% Number of credits that a queue process is given by the message store
391+
%% By default, a queue process is given 4000 message store credits,
392+
%% and then 800 for every 800 messages that it processes.
393+
%%
394+
%% {msg_store_credit_disc_bound, {4000, 800}},
395+
396+
%% Minimum number of messages with their queue position held in RAM required
397+
%% to trigger writing their queue position to disk.
398+
%%
399+
%% This value MUST be higher than the initial msg_store_credit_disc_bound value,
400+
%% otherwise paging performance may worsen.
401+
%%
402+
%% {msg_store_io_batch_size, 4096},
403+
404+
%% Number of credits that a connection, channel or queue are given.
405+
%%
406+
%% By default, every connection, channel or queue is given 400 credits,
407+
%% and then 200 for every 200 messages that it sends to a peer process.
408+
%% Increasing these values may help with throughput but also can be dangerous:
409+
%% high credit flow values are no different from not having flow control at all.
410+
%%
411+
%% See https://www.rabbitmq.com/blog/2015/10/06/new-credit-flow-settings-on-rabbitmq-3-5-5/
412+
%% and http://alvaro-videla.com/2013/09/rabbitmq-internals-credit-flow-for-erlang-processes.html.
413+
%%
414+
%% {credit_flow_default_credit, {400, 200}},
415+
416+
%% Number of milliseconds before a channel operation times out.
417+
%%
418+
%% {channel_operation_timeout, 15000},
419+
420+
%% Number of queue operations required to trigger an explicit garbage collection.
421+
%% Increasing this value may reduce CPU load and increase peak RAM consumption of queues.
422+
%%
423+
%% {queue_explicit_gc_run_operation_threshold, 1000},
424+
425+
%% Number of lazy queue operations required to trigger an explicit garbage collection.
426+
%% Increasing this value may reduce CPU load and increase peak RAM consumption of lazy queues.
427+
%%
428+
%% {lazy_queue_explicit_gc_run_operation_threshold, 1000},
429+
430+
%% Number of times disk monitor will retry free disk space queries before
431+
%% giving up.
432+
%%
433+
%% {disk_monitor_failure_retries, 10},
434+
435+
%% Milliseconds to wait between disk monitor retries on failures.
436+
%%
437+
%% {disk_monitor_failure_retry_interval, 120000},
438+
341439
%% Whether or not to enable background GC.
342440
%%
343441
%% {background_gc_enabled, false},
344-
%%
442+
345443
%% Interval (in milliseconds) at which we run background GC.
346444
%%
347-
%% {background_gc_target_interval, 60000}
445+
%% {background_gc_target_interval, 60000},
446+
447+
%% Message store operations are stored in a sequence of files called segments.
448+
%% This controls max size of a segment file.
449+
%% Increasing this value may speed up (sequential) disk writes but will slow down segment GC process.
450+
%% DO NOT CHANGE THIS for existing installations.
451+
%%
452+
%% {msg_store_file_size_limit, 16777216},
453+
454+
%% Whether or not to enable file write buffering.
455+
%%
456+
%% {fhc_write_buffering, true},
457+
458+
%% Whether or not to enable file read buffering. Enabling
459+
%% this may slightly speed up reads but will also increase
460+
%% node's memory consumption, in particular on boot.
461+
%%
462+
%% {fhc_read_buffering, false}
348463

349464
]},
350465

@@ -559,21 +674,27 @@
559674
%%
560675
%% {prefetch, 10},
561676

562-
%% TCP/SSL Configuration (as per the broker configuration).
677+
%% TLS listeners.
678+
%% See http://www.rabbitmq.com/networking.html
563679
%%
564680
%% {tcp_listeners, [1883]},
565681
%% {ssl_listeners, []},
566682

567683
%% Number of Erlang processes that will accept connections for the TCP
568-
%% and SSL listeners.
684+
%% and TLS listeners.
685+
%% See http://www.rabbitmq.com/networking.html
569686
%%
570687
%% {num_tcp_acceptors, 10},
571688
%% {num_ssl_acceptors, 1},
572689

573-
%% TCP/Socket options (as per the broker configuration).
690+
%% TCP socket options.
691+
%% See http://www.rabbitmq.com/networking.html
574692
%%
575-
%% {tcp_listen_options, [{backlog, 128},
576-
%% {nodelay, true}]}
693+
%% {tcp_listen_options, [
694+
%% {backlog, 128},
695+
%% {linger, {true, 0}},
696+
%% {exit_on_close, false}
697+
%% ]},
577698
]},
578699

579700
%% ----------------------------------------------------------------------------

src/rabbit_variable_queue.erl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@
178178
%% (betas+gammas+delta)/(target_ram_count+betas+gammas+delta). I.e. as
179179
%% the target_ram_count shrinks to 0, so must betas and gammas.
180180
%%
181-
%% The conversion of betas to gammas is done in batches of at least
182-
%% ?IO_BATCH_SIZE. This value should not be too small, otherwise the
183-
%% frequent operations on the queues of q2 and q3 will not be
184-
%% effectively amortised (switching the direction of queue access
185-
%% defeats amortisation). Note that there is a natural upper bound due
186-
%% to credit_flow limits on the alpha to beta conversion.
181+
%% The conversion of betas to deltas is done if there are at least
182+
%% ?IO_BATCH_SIZE betas in q2 & q3. This value should not be too small,
183+
%% otherwise the frequent operations on the queues of q2 and q3 will not be
184+
%% effectively amortised (switching the direction of queue access defeats
185+
%% amortisation). Note that there is a natural upper bound due to credit_flow
186+
%% limits on the alpha to beta conversion.
187187
%%
188188
%% The conversion from alphas to betas is chunked due to the
189189
%% credit_flow limits of the msg_store. This further smooths the
@@ -2384,6 +2384,9 @@ reduce_memory_use(State = #vqstate {
23842384
end,
23852385

23862386
State3 =
2387+
%% If there are more messages with their queue position held in RAM,
2388+
%% a.k.a. betas, in Q2 & Q3 than IoBatchSize,
2389+
%% write their queue position to disk, a.k.a. push_betas_to_deltas
23872390
case chunk_size(?QUEUE:len(Q2) + ?QUEUE:len(Q3),
23882391
permitted_beta_count(State1)) of
23892392
S2 when S2 >= IoBatchSize ->

0 commit comments

Comments
 (0)