Stories

Detail Return Return

nameko 的 rpc 頻繁創建和銷燬隊列,會對 rabbitmq 會很大的負載壓力,cpu 飆升 - Stories Detail

我的 rabbitmq 是 24core48GB 的配置

圖片.png

圖片.png

發現 nameko 的 rpc 一多,從 aliyun 的 ecs 監控面板中看到 rabbitmq 的 cpu 佔用率就從 25%上升到 75% 了

原因就是在於 nameko 的每次 rpc 都會新建鏈接、開啓新的 channel、創建返回結果的隊列

with ClusterRpcProxy(config) as cluster_rpc:
    online_micro_drama_record_number = cluster_rpc.parse_rpc_service.parse_online_micro_drama_record_number_rpc_v3(
        parser_name=parser_name,
        clip_url=clip_url,
        video_download_url=video_download_url,
    )

解決辦法或許可以參考:nameko 避坑筆記:避免頻繁實例化 ClusterRpcProxy

user avatar u_14540126 Avatar itwhat Avatar ligaai Avatar cryptorzz Avatar zbooksea Avatar ximinghui Avatar leeqvip Avatar niandou Avatar aizuiyoujie Avatar yinuo112 Avatar huangxincheng Avatar lsjwq Avatar
Favorites 14 users favorite the story!
Favorites

Add a new Comments

Some HTML is okay.