<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); "><div>You could try statelessd, which is designed for this scenario: <a href="https://github.com/gmr/statelessd">https://github.com/gmr/statelessd</a></div><div><br></div><blockquote style="margin:0 0 0 40px; border:none; padding:0px;"><div><span style="color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 25px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254);">"</span><span style="color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 25px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">The goal is to allow for persistent connections to RabbitMQ for systems and languages that do not facilitate long-running persisted connections like PHP."</span></div></blockquote><div><span style="color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 25px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; "><br></span></div><div>Or use FastCGI for your PHP.</div><div><br></div><div style="font-size: 14px; font-family: Calibri, sans-serif; ">ml</div><div style="font-size: 14px; font-family: Calibri, sans-serif; "><br></div><span id="OLK_SRC_BODY_SECTION" style="font-size: 14px; font-family: Calibri, sans-serif; "><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Michael Klishin <<a href="mailto:michael.s.klishin@gmail.com">michael.s.klishin@gmail.com</a>><br><span style="font-weight:bold">Reply-To: </span> rabbitmq <<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><br><span style="font-weight:bold">Date: </span> Sunday, May 19, 2013 7:40 AM<br><span style="font-weight:bold">To: </span> rabbitmq <<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a>><br><span style="font-weight:bold">Subject: </span> Re: [rabbitmq-discuss] Expected msg/s per CPU core<br></div><div><br></div><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2013/5/19 Nikola Savic <span dir="ltr"><<a href="mailto:niks@osic.rs" target="_blank">niks@osic.rs</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
With every execution, PHP scripts connects to RabbitMQ and post
1-3 messages</blockquote></div><br>So the consumer apps are constantly being terminated, started, then they connect and consume</div><div class="gmail_extra">messages (I assume using basic.get)? That's far from being very efficient, RabbitMQ was</div><div class="gmail_extra">really built with long-running apps in mind.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Plus, with basic.get and immediate processing you get one message at a time. With "push API"</div><div class="gmail_extra">consumers it can be multiple messages at once. See <a href="http://www.rabbitmq.com/tutorials/tutorial-two-python.html">http://www.rabbitmq.com/tutorials/tutorial-two-python.html</a>,</div><div class="gmail_extra">
for example.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't really know what to recommend besides at least not reconnecting all the time. AFAIK php clients</div><div class="gmail_extra">only support basic.get and not "push" deliveries, neither a long-running PHP process can offer any</div><div class="gmail_extra">way of concurrent processing.</div><div class="gmail_extra"><br></div><div class="gmail_extra">You can try fetching multiple messages before you process them.<br>-- <br>MK<br><br><a href="http://github.com/michaelklishin" target="_blank">http://github.com/michaelklishin</a><br><a href="http://twitter.com/michaelklishin" target="_blank">http://twitter.com/michaelklishin</a><br></div></div></span></body></html>