[rabbitmq-discuss] Will this work?

Dinabandhu Mitra Dinabandhu.Mitra at tecnotree.com
Wed Feb 17 08:17:15 GMT 2010

Hi Tony,

First let me thank you for answering this on a vacation.

1. What do you mean by full Connection? Should I create a completely separate socket per thread? Or does it mean AMQP level connection?
2. If it is AMQP level connection, I have tried that before but it did not seem to work. I can try again if you feel it should work.
3. If it is completely separate socket, that is separate socket for each consumer and producer I seem to land in interaction between nagle and delayed ack which is playing havoc with response times. Disabling nagle does not help. 
4. If I share a (single socket + AMQP connection) between one producer and one consumer each on a different thread in same application using different channels seem to give best results. But in this configuration total message throughput that I can achieve with a reasonable latency (sub millisecond) on 1 KB message size is around 1000/sec. This throughput is somewhat restrictive.
5. Of course I can use multiple "pairs" of such consumers and producers to scale up but from the application point of view producers and consumers are not really paired, that is one application instance will have m producers and n consumers.

As you said, the library is not designed to work with pthreaded applications and possibly won't really work for our application at the end. I am just trying to see much can we do with this as I don't have any alternative at the moment.


> -----Original Message-----
> From: Tony Garnock-Jones [mailto:tonyg at lshift.net]
> Sent: Wednesday, February 17, 2010 12:14 PM
> To: Dinabandhu Mitra
> Cc: rabbitmq-discuss at lists.rabbitmq.com; rabbitmq info
> Subject: Re: [rabbitmq-discuss] Will this work?
> Dinabandhu Mitra wrote:
> > Thanks. I must have misunderstood the post. I will change my code to
> > have a single shared socket, single shared connection but per thread
> > channel.
> I would be extremely careful here. The rabbitmq-c library is built with
> event-driven, single-threaded applications in mind, and does not yet
> cater to any of the requirements of pthreaded applications. I do not
> think you will have much luck sharing a single connection between
> multiple threads, even using multiple channels. Instead, I would
> recommend a separate full *connection* per thread when using the
> rabbitmq-c library.
> Regards,
>   Tony

More information about the rabbitmq-discuss mailing list