惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
I
InfoQ
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
C
Check Point Blog
月光博客
月光博客
L
LangChain Blog
GbyAI
GbyAI

Celery

请教如果 celery 任务已经在进行中,还能如何跟用户交互么 Celery 的诡异问题,请大佬们看看 如何建立多个队列? Celery + RabbitMQ 是最佳组合么?与 SQLAlchemy 相比有什么优势?
请教一个 celery 的 worker 进程越来越多的问题
longmeier90 · 2022-06-27 · via Celery
我用 django 项目 配置了 celery ,因为 16 个队列,起了 6 个 worker 去消耗。但是我发现 celery 的 worker 数量会一直自动增加,不知道是为什么,更要命的是内存占用挺大的。服务器都报警了,我把 celery-worker 进程结束掉,内存就会降下来。celery-worker 我是用 supervisor 去启动的。

django/celery-config 文件配置

worker_concurrency = 6
celeryd_concurrency = 6
# 每个 worker 最多执行 10KB 任务被销毁, 可以防止内存泄露
worker_max_tasks_per_child = 40
# 单个任务的最大运行时间
task_time_limit = 30 * 60

supervisord/celry.ini


directory=/data/code/prd/bolin/src
command=/data/code/prd/bolin/env/bin/celery -A config worker --concurrency=6  -l INFO
user=pyer
autostart=true
autorestart=true
stopsignal=QUIT
stopwaitsecs=60
stopasgroup=true
killasgroup=true