diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2013-01-30 14:29:16 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-01-30 14:29:16 +0000 |
commit | a39bc21538e580476fca3b5a9252dd360ea82147 (patch) | |
tree | 418291ac6c5756540a35eec35da24672c0404afa /src/rabbit_msg_store_index.erl | |
parent | 6dccc04b620268999e96e6eec5cd44efbc8893fd (diff) | |
download | rabbitmq-server-a39bc21538e580476fca3b5a9252dd360ea82147.tar.gz |
reduce the default qi journal size
a large journal size improves performance by
- writing larger blocks to disk in one go (since in many scenarios we
end up writing the entire journal in one go)
- reducing fsync frequency (since in many scenarios we only sync when
rolling the journal)
- records for messages which get published, delivered and acked in the
lifetime of a journal don't need to be written to segment files. To
the point where we may be able to skip writing segment files
altogether.
BUT a large size also has downsides:
- increased memory consumption
- increased amount of data loss in the event of a crash
So how do we pick a figure? Well, ultimately we may want to
dynamically adjust the size based on memory pressure, but that is a
fairly involved / risky change. Meanwhile, what would be the *lowest*
figure that still delivers all of the benefits, just somewhat less
than currently?
A single qi segment holds entries for 16k messages. We want the
journal to be able to hold at least an entire segment's worth of
publishes, delivers and acks, which would be 16k x 3 entries. That way
the aforementioned segment write reductions can happen when the queue
is small.
However, with a size of *exactly* 16k x 3, we would generally
only avoid whole segment writes when messages get published, delivered
and ack'ed straight away, which only happens when consuming in noack
mode from empty queues. So we want to add some headroom in order to
extend the benefits to a wider range of modes of queue operation.
Hence 16k x 4 is a good choice. It should allow most "near empty" fast
moving queues to avoid segment writes.
Diffstat (limited to 'src/rabbit_msg_store_index.erl')
0 files changed, 0 insertions, 0 deletions