Skip to content

Commit

Permalink
feat: increase keepalive timeout (#267)
Browse files Browse the repository at this point in the history
The default uvicorn keepalive timeout is 5s.
This will allow servers connecting to served fal apps to use longer
keepalives and reuse TCP connections, avoiding extra roundtrips.

Signed-off-by: squat <[email protected]>
  • Loading branch information
squat authored Jul 25, 2024
1 parent 93e051b commit e21951a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/fal/src/fal/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,9 @@ def serve(self) -> None:
from uvicorn import Config

app = self._build_app()
server = Server(config=Config(app, host="0.0.0.0", port=8080))
server = Server(
config=Config(app, host="0.0.0.0", port=8080, timeout_keep_alive=300)
)
metrics_app = FastAPI()
metrics_app.add_route("/metrics", handle_metrics)
metrics_server = Server(config=Config(metrics_app, host="0.0.0.0", port=9090))
Expand Down

0 comments on commit e21951a

Please sign in to comment.