forked from leffss/devops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deamon.ini
59 lines (56 loc) · 1.38 KB
/
deamon.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[program:gunicorn]
directory=/devops
command=gunicorn -c gunicorn.cfg devops.wsgi:application
# stdout_logfile=/var/log/devops.log
# stderr_logfile=/var/log/devops.log
loglevel=info
redirect_stderr=true
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600
[program:daphne]
directory=/devops
command=daphne -b 0.0.0.0 -p 8001 devops.asgi:application
# stdout_logfile=/var/log/devops.log
# stderr_logfile=/var/log/devops.log
loglevel=info
redirect_stderr=true
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600
[program:sshd]
directory=/devops
command=python manage.py sshd
# stdout_logfile=/var/log/sshd.log
# stderr_logfile=/var/log/sshd.log
loglevel=info
redirect_stderr=true
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600
[program:celery-worker]
directory=/devops
;environment=PYTHONOPTIMIZE="1"
# -c worker进程数,默认 cpu 核数
# --max-tasks-per-child 每个worker执行了多少个任务就会被新的worker替代,
# 可以设置小点防止长时间运行Celery有可能发生内存泄露
command=celery -A devops worker -l info -c 3 --max-tasks-per-child 40 --prefetch-multiplier 1
# stdout_logfile=/var/log/celeryd.log
# stderr_logfile=/var/log/celeryd.log
loglevel=info
redirect_stderr=true
user=root
stopsignal=INT
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600