v2Donuts
V2EX  ›  问与答

Python 多线程使用 rabbitmq 的性能问题

  •  
  •   v2Donuts · Apr 14, 2020 · 1393 views
    This topic created in 2235 days ago, the information mentioned may be changed or developed.

    开发的时候使用一个线程从服务器接收消息,另一个线程对消息进行处理
    同时运行两个线程的时候接收消息的速度会变慢。。很奇怪,有大佬知道原因吗?

    1 replies    2020-04-15 15:57:45 +08:00
    ohyeah521
        1
    ohyeah521  
       Apr 15, 2020
    python 不合适多线程,线程切换比较耗 cpu 时钟,你可以尝试多进程,原因你搜索一下 GIL
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3235 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 13:13 · PVG 21:13 · LAX 06:13 · JFK 09:13
    ♥ Do have faith in what you're doing.