docs: 更新后端文档
- 更新 api/README.md - 更新 api/docs/本地开发环境配置.md - 更新 api/docs/测试脚本使用说明.md Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
||||
│ │
|
||||
│ ┌─────────────────┐ │
|
||||
└─────────────▶│ SQLite/DB │◀─────────────┘
|
||||
└─────────────▶│ PostgreSQL │◀─────────────┘
|
||||
│ (持久化存储) │
|
||||
└─────────────────┘
|
||||
```
|
||||
@@ -65,8 +65,8 @@ DEEPSEEK_BASE_URL=https://api.deepseek.com
|
||||
REDIS_URL=redis://localhost:6379/0
|
||||
REDIS_SESSION_TTL=86400 # 会话过期时间(秒),默认 24 小时
|
||||
|
||||
# 数据库配置
|
||||
DATABASE_URL=sqlite+aiosqlite:///./life_echo.db
|
||||
# 数据库配置(PostgreSQL,与线上一致)
|
||||
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/life_echo
|
||||
|
||||
# JWT 配置
|
||||
SECRET_KEY=your-secret-key-change-in-production
|
||||
@@ -187,7 +187,7 @@ Redis 连接失败: Error connecting to redis://localhost:6379/0
|
||||
### 支持几百用户
|
||||
|
||||
1. **Redis 集群**:对于高并发场景,考虑使用 Redis 集群
|
||||
2. **数据库**:从 SQLite 迁移到 PostgreSQL
|
||||
2. **数据库**:使用 PostgreSQL,按负载调整连接池与实例
|
||||
3. **Celery Worker**:根据负载增加 Worker 数量
|
||||
4. **API 实例**:使用负载均衡器部署多个 API 实例
|
||||
|
||||
|
||||
Reference in New Issue
Block a user