Add uvicorn workers and Redis timeouts
- Run uvicorn with 4 workers to handle concurrent requests - Add socket_timeout and socket_connect_timeout to Redis client (5s) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,9 @@ parsed = urlparse(REDIS_URL)
|
|||||||
redis_client = redis.Redis(
|
redis_client = redis.Redis(
|
||||||
host=parsed.hostname or 'localhost',
|
host=parsed.hostname or 'localhost',
|
||||||
port=parsed.port or 6379,
|
port=parsed.port or 6379,
|
||||||
db=int(parsed.path.lstrip('/') or 0)
|
db=int(parsed.path.lstrip('/') or 0),
|
||||||
|
socket_timeout=5,
|
||||||
|
socket_connect_timeout=5
|
||||||
)
|
)
|
||||||
RUNS_KEY_PREFIX = "artdag:run:"
|
RUNS_KEY_PREFIX = "artdag:run:"
|
||||||
RECIPES_KEY_PREFIX = "artdag:recipe:"
|
RECIPES_KEY_PREFIX = "artdag:recipe:"
|
||||||
@@ -3986,4 +3988,4 @@ async def ui_run_partial(run_id: str, request: Request):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run(app, host="0.0.0.0", port=8100)
|
uvicorn.run(app, host="0.0.0.0", port=8100, workers=4)
|
||||||
|
|||||||
Reference in New Issue
Block a user