限制 bot 容器资源占用
This commit is contained in:
+7
-1
@@ -40,10 +40,16 @@ TELEGRAM_QUERY_TOPIC_ID=
|
|||||||
TELEGRAM_QUERY_TOPIC_MAP=
|
TELEGRAM_QUERY_TOPIC_MAP=
|
||||||
POLYWEATHER_BOT_GROUP_INVITE_URL=
|
POLYWEATHER_BOT_GROUP_INVITE_URL=
|
||||||
POLYWEATHER_APP_URL=https://polyweather-pro.vercel.app
|
POLYWEATHER_APP_URL=https://polyweather-pro.vercel.app
|
||||||
# High-frequency airport push loop. Keep this at 1 on shared 1CPU VPS.
|
# High-frequency airport push loop. Keep workers at 1 on shared VPS.
|
||||||
TELEGRAM_AIRPORT_PUSH_ENABLED=true
|
TELEGRAM_AIRPORT_PUSH_ENABLED=true
|
||||||
TELEGRAM_AIRPORT_PUSH_INTERVAL_SEC=60
|
TELEGRAM_AIRPORT_PUSH_INTERVAL_SEC=60
|
||||||
TELEGRAM_AIRPORT_PUSH_MAX_WORKERS=1
|
TELEGRAM_AIRPORT_PUSH_MAX_WORKERS=1
|
||||||
|
# Docker-only safety limits for the bot service.
|
||||||
|
POLYWEATHER_BOT_CPUS=0.75
|
||||||
|
POLYWEATHER_BOT_MEM_LIMIT=768m
|
||||||
|
POLYWEATHER_BOT_MEMSWAP_LIMIT=1g
|
||||||
|
POLYWEATHER_BOT_AIRPORT_PUSH_INTERVAL_SEC=180
|
||||||
|
POLYWEATHER_BOT_AIRPORT_PUSH_MAX_WORKERS=1
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# 3) Weather + cache
|
# 3) Weather + cache
|
||||||
|
|||||||
+7
-1
@@ -9,6 +9,13 @@ services:
|
|||||||
<<: *polyweather-base
|
<<: *polyweather-base
|
||||||
container_name: polyweather_bot
|
container_name: polyweather_bot
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
cpus: "${POLYWEATHER_BOT_CPUS:-0.75}"
|
||||||
|
mem_limit: "${POLYWEATHER_BOT_MEM_LIMIT:-768m}"
|
||||||
|
memswap_limit: "${POLYWEATHER_BOT_MEMSWAP_LIMIT:-1g}"
|
||||||
|
pids_limit: 256
|
||||||
|
environment:
|
||||||
|
TELEGRAM_AIRPORT_PUSH_INTERVAL_SEC: "${POLYWEATHER_BOT_AIRPORT_PUSH_INTERVAL_SEC:-180}"
|
||||||
|
TELEGRAM_AIRPORT_PUSH_MAX_WORKERS: "${POLYWEATHER_BOT_AIRPORT_PUSH_MAX_WORKERS:-1}"
|
||||||
volumes:
|
volumes:
|
||||||
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/var/lib/polyweather
|
||||||
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
|
- ${POLYWEATHER_RUNTIME_DATA_DIR:-/var/lib/polyweather}:/app/data
|
||||||
@@ -36,4 +43,3 @@ services:
|
|||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user