<div>Jim,</div>
<div>�</div>
<div>I believe that you are looking at a TCP/IP issue here (which you may or may not be able to address by modifying the libRabbitMQ code).�My guess is that if you set the TCP/IP kernel parameter tcpnodelack�(or whatever it is called on your operating system) to 1 (i.e. don&#39;t delay acknowledging TCP data), you will see things improve rather significantly. Depending on what platform you&#39;re using, you may be able to stick a setsockopt() call (using the option <span style="FONT-SIZE: 11pt; FONT-FAMILY: &#39;Calibri&#39;,&#39;sans-serif&#39;; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: &#39;Times New Roman&#39;; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">TCP_NODELACK) in amqp_socket.c between the socket() call and the connect() call instead of having to make the chnage globally by messing with the kernel parameter.</span><br>
</div>
<div>For what it&#39;s worth, I encountered this problem with libRabbitMQ-C on OpenVMS just last week.. Luky for me I&#39;ve seen the problem before. Seem to recall that you guys at <a href="http://umich.edu">umich.edu</a> used to have some OpenVMS systems...</div>

<div>�</div>
<div>Regards,</div>
<div>Brett</div>
<div><br><br>�</div>
<div class="gmail_quote">On Sat, Jun 26, 2010 at 11:54 AM, David Wragg <span dir="ltr">&lt;<a href="mailto:david@rabbitmq.com">david@rabbitmq.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Jim,<br>
<div class="im"><br>Jim Irrer &lt;<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>&gt; writes:<br>&gt; I&#39;m working on two functions that act as a client-server pair. �They<br>&gt; use two amq.direct queues to communicate. �When ever either of<br>
&gt; them calls the amqp_simple_wait_frame function, it does not return<br>&gt; for 436618 microseconds.<br>&gt;<br>&gt; Some other background info that might be relevant:<br>&gt;<br>&gt; If I only send messages in one direction it&#39;s really fast.<br>
&gt;<br>&gt; Both processes are using separate connectors and different sockets.<br>&gt;<br>&gt; I used the amqp_consumer.c amqp_producer.c code in<br>&gt; the examples directory as a reference.<br>&gt;<br>&gt; Is there a way to avoid this delay?<br>
<br></div>I&#39;m not sure what you are really asking here. �As its name suggests,<br>amqp_simple_wait_frame waits for a frame to arrive. �It will typically<br>attempt to read from the socket connected to the AMQP server. �If no<br>
data is available, it will block until data is available. �The resulting<br>delays are thus an intrinsic feature of amqp_simple_wait_frame.<br><br>Are you sure that the 400ms delay does not simply reflect the wait for a<br>
message to arrive?<br><br>I&#39;m guessing, but perhaps the problem is that you want a single<br>application to publish and consume messages concurrently, and you are<br>finding that the synchronous nature of amqp_simple_wait_frame is an<br>
obstacle? �If so, the simplest work around would be to have two threads,<br>one to publish and one to consume, and open a separate AMQP connection<br>in each thread.<br>
<div class="im"><br>&gt; Also ...<br>&gt;<br>&gt; Could I use the same socket in each program as long as it was only<br>&gt; used by one thread at a time?<br>&gt;<br>&gt; Could I use the same connection in each program if it was only<br>
&gt; used by one thread at a time?<br><br></div>What&#39;s the distinction between socket and connection here?<br><br>librabbitmq does not do anything to explicitly support multithreading,<br>but neither does it do anything to conflict with it. �If you, the<br>
application programmer, ensure that for a given connection, only one<br>thread uses librabbitmq at a time, you should be safe.<br><font color="#888888"><br>--<br>David Wragg<br>Staff Engineer, RabbitMQ<br>SpringSource, a division of VMware<br>
_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</font></blockquote></div><br>