diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-06-10 19:04:58 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-06-10 19:04:58 +0100 |
| commit | bff27f50060f08aed88e16c7473750b371eeee3b (patch) | |
| tree | e8fffe0007428d561c2ea2b7e91f8bf32849c672 /src/rabbit.erl | |
| parent | e8f690e23c4f350f6eb8dc9ccd8350a9439afc35 (diff) | |
| download | rabbitmq-server-git-bff27f50060f08aed88e16c7473750b371eeee3b.tar.gz | |
Added means to alter all queues and switch to disk_only mode in the disk queue.
rabbit_queue_mode_manager:change_memory_usage(undef, true).
this will first ask all queues to switch from mixed to disk mode, and will on a 2nd call, ask the disk queue to switch to disk only mode.
rabbit_queue_mode_manager:change_memory_usage(undef, false).
moves the other way.
This all works, eg set MulticastMain pushing in messages and switch modes, and it's fine.
One immediate problem is that as soon as everything becomes disk only, the performance suffers, so as a result messages build up. This is as expected. Then, going back to the middle mode (i.e. disk queue in ram_disk mode and queues in disk mode), the switch in the disk queue eats up a lot of memory. I suspect this is the effect of converting the mnesia table from disc_only_copies to disc_copies when there are 40k+ messages in there (one row per message). As a result, this conversion on its own is very dangerous to make. It might be more sensible to use the "weird" mode, where the queues are in mixed mode and the disk queue is in disk_only mode so as to try and get the queues to drain as fast as possible, reducing the size of the mnesia table so that when it is finally converted back, it's small.
More experimentation is needed.
I'll hook the above commands into rabbitmqctl soon.
Diffstat (limited to 'src/rabbit.erl')
| -rw-r--r-- | src/rabbit.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index ce73f6ce6d..44e4dc7f25 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -138,6 +138,8 @@ start(normal, []) -> {ok, MemoryAlarms} = application:get_env(memory_alarms), ok = rabbit_alarm:start(MemoryAlarms), + + ok = start_child(rabbit_queue_mode_manager), ok = rabbit_binary_generator: check_empty_content_body_frame_size(), |
