2013-07-25 59 views
0

我在龍捲風服務器上使用了Supervisor和Celery(注意:不是tcelery,因爲我的服務器還沒有使用任何異步功能)與三名工人:w1,w2和w3。每個通過將下面的到/etc/supervisord.conf具有10併發我經由主管做到這一點:芹菜子過程應該顯示在ps aux |上less

[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 

第一個[程序]塊是用於運行龍捲風我的主要Python應用程序。接下來的三名(顯然)是我的芹菜工人。令我擔心的是,當我「supervisorctl全部啓動」時,所有30個進程都出現在列表中:

root 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任務--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任務--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任務--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任務--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任務--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任務--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任務--loglevel = 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任務--loglevel = 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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--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任務--loglevel = INFO --concurrency = 10 -n w1 root 2611 0.0 1.6 175144 28640? S 13:40 0:00/usr/bin/python/usr/local/bin/celery worker -A任務--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任務--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任務--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任務--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任務--loglevel = 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任務--loglevel = INFO --concurrency = 10 -n w2

這些是30個Celery進程,一些額外的(不太確定爲什麼額外的那些......) 我的印象是,任務完成後不必要的進程應該終止。這是這種情況還是我只是瘋了?

在此先感謝。

回答

0

是的,它們都應該顯示爲過程。但是,您可能想要在程序配置下使用stopasgroup = true和killasgroup = true選項來立即停止所有子進程,否則,即使在使用supervisorctl運行stop [programname]命令後,它們仍可能繼續運行。