<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't delay acknowledging TCP data), you will see things improve rather significantly. Depending on what platform you're using, you may be able to stick a setsockopt() call (using the option <span style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; 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: 'Times New Roman'; 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's worth, I encountered this problem with libRabbitMQ-C on OpenVMS just last week.. Luky for me I'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"><<a href="mailto:david@rabbitmq.com">david@rabbitmq.com</a>></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 <<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>> writes:<br>> I'm working on two functions that act as a client-server pair. They<br>> use two amq.direct queues to communicate. When ever either of<br>
> them calls the amqp_simple_wait_frame function, it does not return<br>> for 436618 microseconds.<br>><br>> Some other background info that might be relevant:<br>><br>> If I only send messages in one direction it's really fast.<br>
><br>> Both processes are using separate connectors and different sockets.<br>><br>> I used the amqp_consumer.c amqp_producer.c code in<br>> the examples directory as a reference.<br>><br>> Is there a way to avoid this delay?<br>
<br></div>I'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'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>> Also ...<br>><br>> Could I use the same socket in each program as long as it was only<br>> used by one thread at a time?<br>><br>> Could I use the same connection in each program if it was only<br>
> used by one thread at a time?<br><br></div>What'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>