Tune production concurrency for small VPS

This commit is contained in:
2569718930@qq.com
2026-06-13 01:59:28 +08:00
parent f115be1fd3
commit f0b1b57ae2
5 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -987,17 +987,17 @@ async def _build_city_detail_batch_item_async(
def _city_detail_batch_concurrency() -> int:
try:
value = int(os.getenv("POLYWEATHER_CITY_DETAIL_BATCH_CONCURRENCY", "3") or "3")
value = int(os.getenv("POLYWEATHER_CITY_DETAIL_BATCH_CONCURRENCY", "2") or "2")
except ValueError:
value = 3
value = 2
return max(1, min(4, value))
def _city_detail_batch_global_concurrency() -> int:
try:
value = int(os.getenv("POLYWEATHER_CITY_DETAIL_BATCH_GLOBAL_CONCURRENCY", "2") or "2")
value = int(os.getenv("POLYWEATHER_CITY_DETAIL_BATCH_GLOBAL_CONCURRENCY", "1") or "1")
except ValueError:
value = 2
value = 1
return max(1, min(4, value))
+1 -1
View File
@@ -43,7 +43,7 @@ SCAN_TERMINAL_PREWARM_PAYLOAD_TIMEOUT_SEC = _env_int(
)
SCAN_TERMINAL_MAX_WORKERS = _env_int(
"POLYWEATHER_SCAN_TERMINAL_MAX_WORKERS",
8,
2,
min_value=1,
max_value=12,
)