[rabbitmq-discuss] php pecl and max channel reached with php-fpm

Michael Klishin mklishin at gopivotal.com
Tue May 27 06:25:47 BST 2014


 On 27 May 2014 at 03:00:50, BeaT Adrian (aditza8 at gmail.com) wrote:
> > After a while (I guess 65500 requests) a problem occurs halting  
> all writes
> "Could not create channel. Connection has no open channel slots  
> remaining"
>  
> From what I have read in the sources is because every tcp connection  
> have an autoincrement channel ID that reaches its max. This happens  
> because every request must use the channel, and is no way to use  
> the same channel ( I could not find a way into the php-amqp channel  
> classs to make it persistent) and scripts cannot communicate  
> ( to use the same instance of the channel as php object).

Every AMQP 0-9-1 connection has 1 or more channels (the max is negotiated
between client and server, so this can be limited by the broker). If you
open a lot of channels, you need to close them, or use more than 1 connection
(which in turn will use more than 1 TCP connection).

Both channels and especially connections in practice take up some resources.
It is very rare that an app actually needs 1000s or 10s of 1000s of channels.

See http://www.rabbitmq.com/tutorials/amqp-concepts.html if you need a more
detailed explanation.

By the way, it is highly recommended that you use https://github.com/videlalvaro/php-amqplib
and not the PECL extension (which is not actively maintained AFAIK).
--  
MK  

Software Engineer, Pivotal/RabbitMQ


More information about the rabbitmq-discuss mailing list