- 后端 gunicorn 加 --threads 4:纯 sync worker 下几张图就占满 3 worker, 健康探针 /api/health/ 拿不到 worker→超时→pod 判不就绪→流量被掐→整站502。 图片生成 I/O 密集,加线程后慢请求不再饿死探针/其他接口。 - 前端图片生成并发上限 2:每张仍独立短请求,但不再 N 条一起砸单 pod 致 OOM。 - ai-tools 全部模特→ 接成展开/收起全部模特(原为纯 span 死链,模特>6 时第7个起选不到)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AirShelf Backend
All backend code lives under AirShelf/core/backend by project decision.
Local bootstrap
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
Start workers in separate terminals:
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
source .venv/bin/activate
celery -A airshelf worker -l info
ffmpeg must be available on PATH for Stage5 export jobs.
Runtime layout
- Django project:
airshelf - Domain apps:
apps/* - Settings module:
airshelf.settings.development - Celery app:
airshelf.celery
Secrets must be supplied by environment variables or .env; never commit values from account.md.
Useful commands
python manage.py check
python manage.py makemigrations --check --dry-run
python manage.py migrate
python manage.py bootstrap_volcano_models
python manage.py test apps.accounts apps.projects apps.billing