chore(配置): 提升容器文件描述符上限到10万
调整原因: - 防止高并发下出现 "too many open files" 错误 - 统一测试与生产环境的 ulimits 配置 改动内容: - 为 sub2api、postgres、redis 设置 nofile - 软硬限制均为 100000 测试: 未运行
This commit is contained in:
@@ -19,6 +19,10 @@ services:
|
|||||||
image: sub2api:latest
|
image: sub2api:latest
|
||||||
container_name: sub2api
|
container_name: sub2api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ulimits:
|
||||||
|
nofile:
|
||||||
|
soft: 100000
|
||||||
|
hard: 100000
|
||||||
ports:
|
ports:
|
||||||
- "${BIND_HOST:-0.0.0.0}:${SERVER_PORT:-8080}:8080"
|
- "${BIND_HOST:-0.0.0.0}:${SERVER_PORT:-8080}:8080"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -107,6 +111,10 @@ services:
|
|||||||
image: postgres:18-alpine
|
image: postgres:18-alpine
|
||||||
container_name: sub2api-postgres
|
container_name: sub2api-postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ulimits:
|
||||||
|
nofile:
|
||||||
|
soft: 100000
|
||||||
|
hard: 100000
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
@@ -132,6 +140,10 @@ services:
|
|||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
container_name: sub2api-redis
|
container_name: sub2api-redis
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ulimits:
|
||||||
|
nofile:
|
||||||
|
soft: 100000
|
||||||
|
hard: 100000
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
command: >
|
command: >
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ services:
|
|||||||
image: weishaw/sub2api:latest
|
image: weishaw/sub2api:latest
|
||||||
container_name: sub2api
|
container_name: sub2api
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ulimits:
|
||||||
|
nofile:
|
||||||
|
soft: 100000
|
||||||
|
hard: 100000
|
||||||
ports:
|
ports:
|
||||||
- "${BIND_HOST:-0.0.0.0}:${SERVER_PORT:-8080}:8080"
|
- "${BIND_HOST:-0.0.0.0}:${SERVER_PORT:-8080}:8080"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -107,6 +111,10 @@ services:
|
|||||||
image: postgres:18-alpine
|
image: postgres:18-alpine
|
||||||
container_name: sub2api-postgres
|
container_name: sub2api-postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ulimits:
|
||||||
|
nofile:
|
||||||
|
soft: 100000
|
||||||
|
hard: 100000
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
@@ -132,6 +140,10 @@ services:
|
|||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
container_name: sub2api-redis
|
container_name: sub2api-redis
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
ulimits:
|
||||||
|
nofile:
|
||||||
|
soft: 100000
|
||||||
|
hard: 100000
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
command: >
|
command: >
|
||||||
|
|||||||
Reference in New Issue
Block a user