<div dir="ltr">Hi,<div><br></div><div>The php-amqplib from here�<a href="https://github.com/videlalvaro/php-amqplib">https://github.com/videlalvaro/php-amqplib</a> can easily publish 4000 msgs in 1.5 seconds and it can consume them in about the same time, using just 1 producer and 1 consumer.</div>
<div><br></div><div style>Is worth noting that the consumers in the benchmark code are doing a�<span style="color:rgb(0,128,128);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;white-space:pre">basic_consume</span>�on the queue and not a basic_get. The benchmark code can be easily run if you check out the library form Github and run <b>make benchmark</b>.</div>
<div><br></div><div style>I think the problem you have on the producing side is the way PHP work, where sharing resources is not so easy due to the script state being cleaned after every request, thus the need of opening one connection per request.</div>
<div style><br></div><div style>Regarding persisting connections with PHP, while the socket connection to RabbitMQ could be persisted across requests, what do we do about channels and the�whole�connection state? With PHP this is not so easy to solve.</div>
<div style><br></div><div style>If you need to achieve max speed from your publishing side I would consider using a REST endpoint as someone suggested already.</div><div style><br></div><div style>On the other hand if your concern regarding publishing speed is to not make the users wait�for the request to finish, then keep in mind that php-fpm has a function called�<span style="color:rgb(68,68,68);font-family:arial,sans-serif;line-height:17.77777862548828px">fastcgi_finish_request. You can call it at the end of your script and then send the messages to RabbitMQ.</span></div>
<div style><span style="color:rgb(68,68,68);font-family:arial,sans-serif;line-height:17.77777862548828px"><br></span></div><div style><span style="color:rgb(68,68,68);font-family:arial,sans-serif;line-height:17.77777862548828px">Regards,</span></div>
<div style><span style="color:rgb(68,68,68);font-family:arial,sans-serif;line-height:17.77777862548828px"><br></span></div><div style><span style="color:rgb(68,68,68);font-family:arial,sans-serif;line-height:17.77777862548828px">Alvaro</span></div>
<div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 19, 2013 at 4:11 PM, Nikola Savic <span dir="ltr">&lt;<a href="mailto:niks@osic.rs" target="_blank">niks@osic.rs</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div><br>
      Consumers are not restarting ... producers are. Every page request
      is new execution of PHP script, which must open new connection
      when trying to send first message, and close it when it finishes.<div><div class="h5"><br>
      <br>
      On 05/19/2013 04:08 PM, Michael Klishin wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div class="gmail_extra"><br>
          <div class="gmail_quote">2013/5/19 Nikola Savic <span dir="ltr">&lt;<a href="mailto:niks@osic.rs" target="_blank">niks@osic.rs</a>&gt;</span><br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              Yes ... it&#39;s the same app which postpones execution of
              some actions using MQ.</blockquote>
          </div>
          <br>
          Then cluster won&#39;t solve your problem because the issue is not
          node delivery rate.<br>
          <br>
          You need to avoid constant restarts and reconnections for your
          consumers or simply</div>
        <div class="gmail_extra">increase their number and/or
          throughput.<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>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><div class="im"><pre>_______________________________________________
rabbitmq-discuss mailing list
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a>
<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>
</pre>
    </div></blockquote>
    <br>
  </div>

<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>
<br></blockquote></div><br></div>