优化更新
This commit is contained in:
@@ -12,7 +12,7 @@ Supervisor 是一个 Python 编写的进程管理工具,用于在 Linux 服务
|
||||
|
||||
## 配置文件示例
|
||||
|
||||
```ini
|
||||
```bash
|
||||
; Supervisor 进程管理配置
|
||||
; 将 command / directory 替换为实际路径后复制到 /etc/supervisor/conf.d/
|
||||
|
||||
@@ -20,7 +20,7 @@ Supervisor 是一个 Python 编写的进程管理工具,用于在 Linux 服务
|
||||
; 启动命令:使用 gunicorn 运行 Django WSGI 应用
|
||||
command=/path/to/venv/bin/gunicorn application.wsgi:application --bind 127.0.0.1:8000 --workers 4 --timeout 120
|
||||
; 项目根目录
|
||||
directory=/data/apps/DjangoAdmin_Django_EleVue
|
||||
directory=/data/apps/DjangoAdmin_Django_AntdVue
|
||||
; 自动启动
|
||||
autostart=true
|
||||
; 异常退出后自动重启
|
||||
@@ -134,7 +134,7 @@ gunicorn application.wsgi:application \
|
||||
|
||||
Supervisor 内置日志轮转功能,通过以下配置控制:
|
||||
|
||||
```ini
|
||||
```bash
|
||||
; 单个日志文件最大 50MB
|
||||
stdout_logfile_maxbytes=50MB
|
||||
; 保留 10 个历史日志文件
|
||||
@@ -153,16 +153,16 @@ stdout_logfile_backups=10
|
||||
|
||||
如需同时管理多个进程(如应用 + Celery Worker):
|
||||
|
||||
```ini
|
||||
```bash
|
||||
[program:djangoadmin]
|
||||
command=/path/to/venv/bin/gunicorn application.wsgi:application --bind 127.0.0.1:8000 --workers 4
|
||||
directory=/data/apps/DjangoAdmin_Django_EleVue
|
||||
directory=/data/apps/DjangoAdmin_Django_AntdVue
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[program:djangoadmin-celery]
|
||||
command=/path/to/venv/bin/celery -A application worker -l info
|
||||
directory=/data/apps/DjangoAdmin_Django_EleVue
|
||||
directory=/data/apps/DjangoAdmin_Django_AntdVue
|
||||
autostart=true
|
||||
autorestart=true
|
||||
numprocs=2
|
||||
|
||||
Reference in New Issue
Block a user