[rabbitmq-discuss] Active Queue Management

Matthew Sackman matthew at rabbitmq.com
Fri May 11 13:49:02 BST 2012


On Fri, May 11, 2012 at 02:36:53PM +0200, Holger Hoffstaette wrote:
> On Fri, 11 May 2012 12:20:37 +0100, Matthew Sackman wrote:
> 
> > On Thu, May 10, 2012 at 02:16:03PM +0100, Matthew Sackman wrote:
> >> I'm actually in the process of implementing CoDel in the Java client.
> > 
> > Which I've done, and blogged about:
> > http://www.rabbitmq.com/blog/2012/05/11/some-queuing-theory-throughput-latency-and-bandwidth/
> > 
> > It seems to work quite nicely for the use cases it's intended for. As
> > ever, all feedback welcome (along with ports to other languages!).
> 
> Nice! Maybe prefer nanoTime() in Delivery() and dequeued(), as otherwise
> you will probably see issues with clock granularity and jumps. Should not
> be a problem as you only need relative time, and nanoTime is (de facto)
> monotonic, though unfortunately a bit more expensive to call.
> The Linux kernel module implementation landed yesterday as well, maybe you
> want to double-check: http://www.spinics.net/lists/netdev/msg198099.html

Thanks for the pointer. I've been out of the Java world since 2006 so
I'm not surprised I've lost touch with the "nuances" of the APIs. I'll
take a look.

BTW, for anyone else wanting to try this stuff out, the "tc" tool from
the iproute package allows you to artificially add delays (and packet
loss) to network interfaces. This is useful in combination with the
CoDelConsumer example (https://gist.github.com/2658727), to watch the
CoDel algorithm kick in as prefetch buffer sojourn time increases.

For example:

Add a 50ms delay to all packets going over loopback:
# tc qdisc add dev lo root netem delay 50ms

And remove it:
# tc qdisc del dev lo root

I promise you the world doesn't end if you make loopback have delay or
loss!

Matthew


More information about the rabbitmq-discuss mailing list