Tune production concurrency for small VPS
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user