PHP Rabbitmq error Broken pipe

fwrite(): send of 13 bytes failed with errno=32 Broken pipe

fwrite(): send of 21 bytes failed with errno=104 Connection reset by peer

 

Rabbitmq to do with the above error message queues Times, when consumer queue a start, Unacked instantly reach hundreds. The investigation: RabbitMQ server in a short time a large number of messages sent to the Consumer, if you have not had time to Ack, then the server will be a huge backlog of UnAcked message and Consumer if not urgent treatment will be in suspended animation or crash.

After Consmer consequence is the collapse, UnAcked news and ReQueue continue to consume resources of MQ

 

solution:

Copy the code
Connection new new AMQPStreamConnection = $ (the HOST, PORT, the USER, the PASS, VHOST); 

$ $ = Channel the connection-> Channel (); 

$ Channel-> queue_declare ( 'qos_queue', to false, to true, to false, to false); 

$ Channel- > basic_qos (null, 10, null ); // add this like this is Unacked inside the value of 10 indicates how much the value of pre-fetched to spend prefetch_count
Copy the code

 

Guess you like

Origin www.cnblogs.com/php-linux/p/11293807.html