Tuneing ping timeouts

This commit is contained in:
2025-07-26 04:00:46 +09:30
parent 45acc4eec6
commit 6e21e49681
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ def _mask(value: str, visible: int = 4) -> str:
app.config["CLOUDFLARE_API_TOKEN"] = os.getenv("CLOUDFLARE_API_TOKEN")
app.config["CLOUDFLARE_ACCOUNT_ID"] = os.getenv("CLOUDFLARE_ACCOUNT_ID")
app.config["CLOUDFLARE_ZONE_ID"] = os.getenv("CLOUDFLARE_ZONE_ID")
app.config["PING_HEARTBEAT_TIMEOUT_SECONDS"] = os.getenv("PING_HEARTBEAT_TIMEOUT_SECONDS",5) # How long before a Websocket PING\PONG is classed as a failure and triggers a worker offline event
app.config["PING_HEARTBEAT_TIMEOUT_SECONDS"] = os.getenv("PING_HEARTBEAT_TIMEOUT_SECONDS",30) # How long before a Websocket PING\PONG is classed as a failure and triggers a worker offline event
app.config["REDIS_URL"] = os.getenv("REDIS_URL","redis://172.17.0.1:6379/2") # Redis Database 2 for operational tasks like websocket server and PING logging
logger.info(
+1 -1
View File
@@ -27,7 +27,7 @@ celery.conf.beat_schedule.update(
},
"reconcile_online_workers-30s": {
"task": "tasks.reconcile_online_workers",
"schedule": 2.0,
"schedule": 30.0,
},
# Add more periodic jobs here if desired
# "collect-system-metrics": {
+4 -3
View File
@@ -14,11 +14,12 @@ REDIS_URL = "redis://172.17.0.1:6379/2"
# Configurable intervals
PING_INTERVAL_SECONDS = 2 # How often to send PING requests
REDIS_PING_EXPIRY_SECONDS = 30 # Redis key expiry value
PING_INTERVAL_SECONDS = 15 # How often to send PING requests
REDIS_PING_EXPIRY_SECONDS = 120 # Redis key expiry value
PING_EXPIRY_SECONDS = 5 # How long between PING and PONG before we raise the alarm - TODO - Impliment this
ASSIGN_INTERVAL_SECONDS = 30
LIVENESS_CHECK_INTERVAL_SECONDS = 5 # How often to cross check connected_workers with ping results from Redis
PING_EXPIRY_SECONDS = 3 # How long between PING and PONG before we raise the alarm
# Database configuration