首页 文章

Celery子流程应该显示在ps aux |上减

提问于
浏览
0

我在龙卷风服务器上使用Supervisord和Celery(注意:不是因为我的服务器还没有使用任何异步功能),还有三个工作人员:w1,w2和w3 . 每个都具有10的并发性 . 我通过将以下内容添加到/etc/supervisord.conf来通过管理器执行此操作:

[program:sendgrid_gateway_server]
command=sudo python main.py -o runserver
numprocs=1
directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway
stdout_logfile=/home/ubuntu/sendgrid_gateway/sendgrid-gateway/logs/server_log.txt
autostart=true
autorestart=true
user=root

[program:sendgrid_gateway_server_w1]
command=celery worker -A tasks --loglevel=INFO --concurrency=10 -n w1
numprocs=1
directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway
stdout_logfile=/home/ubuntu/sendgrid_gateway/sendgrid-gateway/logs/w1_log.txt
autostart=true
autorestart=true
user=root

[program:sendgrid_gateway_server_w2]
command=celery worker -A tasks --loglevel=INFO --concurrency=10 -n w2
numprocs=1
directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway
stdout_logfile=/home/ubuntu/sendgrid_gateway/sendgrid-gateway/logs/w2_log.txt
autostart=true
autorestart=true
user=root

[program:sendgrid_gateway_server_w3]
command=celery worker -A tasks --loglevel=INFO --concurrency=10 -n w3
numprocs=1
directory=/home/ubuntu/sendgrid_gateway/sendgrid-gateway
stdout_logfile=/home/ubuntu/sendgrid_gateway/sendgrid-gateway/logs/w3_log.txt
autostart=true

第一个[program]块是我运行Tornado的主要python应用程序 . 接下来的三个(显然)是我的芹菜 Worker . 令我担心的是,当我“supervisorctl start all”时,所有30个进程都显示在列表中:

根2547 0.0 0.0 40848 1672? S 13:40 0:00 sudo python main.py -o runserver root 2548 0.2 1.9 176140 33020? Sl 13:40 0:04 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2549 0.0 2.1 196848 35632? S 13:40 0:01 python main.py -o runserver root 2560 0.2 1.9 176140 33016? Sl 13:40 0:03 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2561 0.2 1.9 176140 33020? Sl 13:40 0:03 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2581 0.0 1.6 175144 28616? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2582 0.0 1.6 175144 28624? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2583 0.0 1.6 175144 28628? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2584 0.0 1.6 175144 28628? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --lvelvel = INFO --concurrency = 10 -n w3 root 2585 0.0 1.6 175144 28628? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --lvelvel = INFO --concurrency = 10 -n w3 root 2586 0.0 1.6 175144 28632? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2587 0.0 1.6 175144 28632? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2589 0.0 1.6 175144 28636? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2590 0.0 1.6 175144 28644? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2591 0.0 1.6 175144 28640? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w3 root 2595 0.0 1.6 175144 28612? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2596 0.0 1.6 175144 28624? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2597 0.0 1.6 175144 28632? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2598 0.0 1.6 175144 28620? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2599 0.0 1.6 175144 28620? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2600 0.0 1.6 175144 28620? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2601 0.0 1.6 175144 28624? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2602 0.0 1.6 175144 28636? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2603 0.0 1.6 175144 28628? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2604 0.0 1.6 175144 28636? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2605 0.0 1.6 175144 28632? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2608 0.0 1.6 175144 28632? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2609 0.0 1.6 175144 28628? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2610 0.0 1.6 175144 28640? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2611 0.0 1.6 17514428640? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2612 0.0 1.6 175144 28632? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2 root 2613 0.0 1.6 175144 28648? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2614 0.0 1.6 175144 28644? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w1 root 2616 0.0 1.6 175144 28640? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --lvelvel = INFO --concurrency = 10 -n w2 root 2617 0.0 1.6 175144 28636? S 13:40 0:00 / usr / bin / python / usr / local / bin / celery worker -A tasks --loglevel = INFO --concurrency = 10 -n w2

这些是30个Celery进程,加上一些额外的(不太确定为什么有额外的进程......)我的印象是不必要的进程应该在任务完成后终止 . 是这种情况还是我只是疯了?

提前致谢 .

1 回答

  • 0

    是的,它们都应该显示为流程 . 但是,您可能希望在程序配置下使用stopasgroup = true和killasgroup = true选项来立即停止所有子进程,否则即使在使用supervisorctl运行stop [programname]命令后它们也可能继续运行 .

相关问题