rabbitmq的任务大量丢失的两种情况分析
博客专区 > caucy 的博客 > 博客详情
rabbitmq的任务大量丢失的两种情况分析
caucy 发表于1个月前
rabbitmq的任务大量丢失的两种情况分析
  • 发表于 1个月前
  • 阅读 7
  • 收藏 0
  • 点赞 0
  • 评论 0

腾讯云 十分钟定制你的第一个小程序>>>   

使用连接池异常:https://github.com/bninja/pika-pool

多实例异常:大量任务丢失,大量socket.timeout

time.sleep 导致大量socket.close,stackoverflow解释

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 中d

共有 人打赏支持
粉丝 0
博文 41
码字总数 17337
×
caucy
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: