推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
orioleq
V2EX  ›  Python

pika 连接 mq,需要自己写连接池么?

  •  
  •   orioleq · Feb 1, 2024 via iPhone · 4653 views
  •   You need to sign in to view this topic
    This topic created in 1007 days ago, the information mentioned may be changed or developed.

    假设我有 100 个连接,是保持 100 个长连接,还是自己写个连接池复用连接呢? 复用 channel 会不会导致线程不安全的问题? (连的 rabbitmq ,amqp 协议)

    7 replies  •  2024-02-08 12:14:43 +08:00
    vone
    vone
    Feb 1, 2024❤️1
    2
    不需要连接池,rabbitmq 是通过 channel 进行连接复用。所以性能问题应该通过多开 channel 解决。
    zzl22100048
    zzl22100048
    Feb 2, 2024❤️1
    3
    pika 不能复用 channel
    并且也没有内置的重连机制
    julyclyde
    julyclyde
    Feb 2, 2024
    5
    我还以为 qihoo360 那个仿造 redis 的 pika 呢
    这名字咋这么多重名的?
    qiyilai
    qiyilai
    Feb 2, 2024
    6
    kombu +1
    orioleq
    orioleq
    OP
    Feb 8, 2024 via iPhone
    7
    试了下,pika 不支持多线程之间复用 connection
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1277 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 21:37 · PVG 05:37 · LAX 13:37 · JFK 16:37
    ♥ Do have faith in what you're doing.