[rabbitmq-discuss] More throughput using cluster

Alvaro Videla videlalvaro at gmail.com
Sun May 19 15:28:26 BST 2013


The php-amqplib from here https://github.com/videlalvaro/php-amqplib 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.

Is worth noting that the consumers in the benchmark code are doing a
basic_consume 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 *make benchmark*

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

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.

If you need to achieve max speed from your publishing side I would consider
using a REST endpoint as someone suggested already.

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 fastcgi_finish_request. You can call it at the end of
your script and then send the messages to RabbitMQ.



On Sun, May 19, 2013 at 4:11 PM, Nikola Savic <niks at osic.rs> wrote:

> 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.
> On 05/19/2013 04:08 PM, Michael Klishin wrote:
> 2013/5/19 Nikola Savic <niks at osic.rs>
>> Yes ... it's the same app which postpones execution of some actions using
>> MQ.
> Then cluster won't solve your problem because the issue is not node
> delivery rate.
> You need to avoid constant restarts and reconnections for your consumers
> or simply
> increase their number and/or throughput.
> --
> MK
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
> _______________________________________________
> rabbitmq-discuss mailing listrabbitmq-discuss at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://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/20130519/a24e1f49/attachment.htm>

More information about the rabbitmq-discuss mailing list