Hi,
On Wed, Jul 8, 2015 at 7:09 PM, Satyen <
sat...@aagyaa.com> wrote:
> In a scenario with 9 messages in a batch (I'm using the Ack Extension), I
> see the nine messages dequeued together, and they are followed by a
> meta-connect response. This elicits a single meta-connect request from the
> client. Is this observation correct?
You queue on the server at 20 msgs/s.
On the first message queued, the delivery is woken up.
Meanwhile other messages may be queued.
When the delivery runs, it drains the queue; let's say it find 2 messages in it.
The 2 messages are written to the client, along with a /meta/connect
response (because you're using the ack extension).
Meanwhile, other messages are queued, but they are not sent until the
client has issued a /meta/connect request and this has been seen by
the server.
Let's say that the rountrip to the client is 160 ms, so now you have 8
messages in the queue.
When the /meta/connect request from the client is processed, it sees
there are messages in the queue, so it triggers the delivery
immediately.
The 8 messages are drained, written to the client, along with the
/meta/connect response.
And so on.
What causes queueing of messages is the message rate, the roundtrip
and the connection write window (the client is "slow", even though it
may be attached to a large pipe or have a short roundtrip).
If you have bursts at 400 msgs/s, and the client is slow or far away
(or both), then you're going to queue.
Why do you have to send 20 msgs/s to the client ?
Is the client a human ?
If so, it cannot possibly process 20 messages/s (let alone 400),
unless it's a movie to watch.