[rabbitmq-discuss] IModel / thread sharing

Paul Jones pauljones23 at gmail.com
Thu Sep 10 10:50:19 BST 2009


Hi Ashley,

Indeed, the purpose for having the IModel hanging off the IConnection is to
allow a single connection to be shared. Sharing the connection reduces the
number of active connections to your server. It also eliminates a potential
cause of problems when connections are created and torn down in rapid
succession.

If you consider the amount of time taken to establish a connection, then
sharing the connection will certainly help increase your message sending
performance.

Paul.

On Thu, Sep 10, 2009 at 10:43 AM, Ashley van Gerven <ashley.ohq at gmail.com>wrote:

> Hi,
>
> The .NET user guide states that IModel instances should not be shared
> accross threads. So having multiple web requests publishing to the queue
> using the same IModel instance is not an option. However would it be (a)
> possible and (b) advantageous to share a IConnection instance, and have each
> web request create an IModel using the same connection instance? My thought
> is that sharing the IConnection would speed up message publishing (using
> BasicPublish).
>
>
> Thanks
> Ashley
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090910/32e36e35/attachment.htm 


More information about the rabbitmq-discuss mailing list