summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2014-02-24 09:25:32 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2014-02-24 09:25:32 +0000
commite5801702650cde6962eff9fdc2a54a5287828787 (patch)
tree0069a56b5051bb6c14029db6cbca911cbe5a88c5
parent39f6ac92f9c6fe365a45e92e6ece750bae9b23bc (diff)
downloadrabbitmq-server-e5801702650cde6962eff9fdc2a54a5287828787.tar.gz
always prioritise acks (and resume)
The former, so that we preserve ack ordering which, while of no semantic relevance, is good for performance since it allows us to optimise for the common acks-in-order case. The latter since it unblocks a queue from delivering messages and thus is conducive to keeping queue lengths short. We prioritise acks higher than most other messages since they are the only high-frequency message which is guaranteed to free up resources. Prioritising ack and resume all the time is safe since flow control places an upper bound on how many of these we can get, thus preventing starvation of senders of lower-priority messages.
-rw-r--r--src/rabbit_amqqueue_process.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index a1997376..11aabcd5 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -859,9 +859,9 @@ prioritise_cast(Msg, _Len, State) ->
{set_ram_duration_target, _Duration} -> 8;
{set_maximum_since_use, _Age} -> 8;
{run_backing_queue, _Mod, _Fun} -> 6;
- {ack, _AckTags, _ChPid} -> consumer_bias(State);
+ {ack, _AckTags, _ChPid} -> 3;
{notify_sent, _ChPid, _Credit} -> consumer_bias(State);
- {resume, _ChPid} -> consumer_bias(State);
+ {resume, _ChPid} -> 2;
_ -> 0
end.