summaryrefslogtreecommitdiff
path: root/LICENSE-MPL-RabbitMQ
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-02-07 14:04:49 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-02-07 14:04:49 +0000
commit6f4f9e92e126b548fedfafc4b01002fbd98a6649 (patch)
tree360e040b56c1fd8a3a136aceba6b499e73c36bbf /LICENSE-MPL-RabbitMQ
parent4f22b33092c2346578c1e7f73b2c859e37c217ef (diff)
downloadrabbitmq-server-git-6f4f9e92e126b548fedfafc4b01002fbd98a6649.tar.gz
credit_flow-like throttling of queue->writer message flow
Previously we effectively had a credit_spec of {100,1}, i.e. the queue would send up to 100 messages to a consumer channel/writer, and the writer would 'ack' them individually. That is horrendeously inefficient: - when draining a queue, after the queue had sent 100 messages it would block the consumer, unblock when the notify_sent 'ack' came in, send another message to the channel/queue, block again. So a vast amount of work per message - in a cluster, the notify_sent 'acks' effectively doubled the cross-cluster traffic We now use a scheme much like credit_flow. Except we cannot *actually* use credit_flow because - rather than wanting to know whether a sender is lacking credit for *any* receiver, as indicated by credit_flow:blocked(), we need to know *which* receiver we are lacking credit for. - (lack of) credit from receiver should *not* propagate to senders, i.e. sender and receiver credits are completely decoupled. Instead the queue should, er, queue messages when receivers cannot keep up. While we could modify credit_flow to accomodate the above, the changes would be quite unpleasant and not actually reduce the amount of code vs implementing a more specialised scheme. The downside is that the contract for using rabbit_amqqueue:notify_sent becomes somewhat mysterious. In particular it sets up a monitor for queues in the caller, and expects the caller to invoke rabbit_amqqueue:notify_sent_queue_down when a 'DOWN' message is received.
Diffstat (limited to 'LICENSE-MPL-RabbitMQ')
0 files changed, 0 insertions, 0 deletions