rabbitmq的任務大量丟失的兩種狀況分析

使用鏈接池異常:https://github.com/bninja/pika-poolgit

多實例異常:大量任務丟失,大量socket.timeoutgithub

time.sleep 致使大量socket.close,stackoverflow解釋bash

There is a concept of heartbeats. It's basically a way how the server can make sure that the client is still connected.

when you do

time.sleep( body.count('.') )

You blocking the code by N number of seconds. It means that if server would like to send a heartbeat frame to check if your client is still alive, then it will not get a response back, because your code is blocked and doesn't know if heartbeat arrived.

Instead of using time.sleep() you should use connection.sleep() this will also make the code "sleep" for N number of seconds, but it will also communicate with the server and will respond back.

2,使用不當,設計不當,使用ttl 致使數據在rabbitmq 中dsocket

相關文章
相關標籤/搜索