summaryrefslogtreecommitdiff
path: root/include/rabbit.hrl
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-07-16 18:08:41 +0100
committerMatthew Sackman <matthew@lshift.net>2009-07-16 18:08:41 +0100
commitc196178600ced8eec833902be30309d076f98e4a (patch)
tree0c275b0bd774ae21dbfcd1888ec94201c7b5b1ce /include/rabbit.hrl
parent6467e9a1c93c5b88cee3b214f8e9fc89b83743cb (diff)
downloadrabbitmq-server-git-c196178600ced8eec833902be30309d076f98e4a.tar.gz
Well it's better. The memory size is now recovered at start up by doing a foldl on the entire queue. This seems excessive, but it does work. It only takes 75 seconds on my machine to get through 1e6 1024-byte messages, and 160 seconds to get through 2e6 1024-byte messages. So that doesn't worry me any more. Also, it's done in constant memory... ish[0].
Also fixed the queue_mode_manager. Registration does not now produce a mode. Instead, it assumes you're starting up in disk only mode and then the first memory_report will result in the correct mode being set. This is safe and prevents a potentially deadly prefetch being sent when a queue starts up in mixed mode only to be sent to disk_only mode. However, the disk_queue has to start up in mixed mode because if it doesn't it has no way to estimate its memory use for disk mode. As such, it registers and then sends a report of 0 memory use. This guarantees that it can be put in mixed mode, thus it can then respond as necessary to the queue_mode_manager. I've not done anything further at this stage with the use of the erlang queue in the mixed_queue module when in disk mode (the potential per-message cost). Really you don't want to send individual entries here to the disk_queue, you want to batch them up... makes this rather more complex. [0] Sort of wrong. It can use the cache, and if you think about not too big queues sharing messages, this is clearly a good thing. But if there are lots of shared messages then it all goes wrong because the cache will get over populated and exhaust memory. Furthermore, the foldl is entirely in the disk_queue process. This means that during the foldl it won't be reporting memory and it won't be able to respond to request to change its mode. All of which points pretty strongly to the requirement that the prefetch needs to be somewhat more sophisticated.
Diffstat (limited to 'include/rabbit.hrl')
0 files changed, 0 insertions, 0 deletions