-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mangum does not cache database connection pools #493
Comments
I think the easiest way to
The issue then is that the |
I think a section in the documentation regarding runtime-dependent tips would be helpful. In addition to this topic, disabling pgSTAC's default DB pooling parameters (ie setting both to stac-fastapi/stac_fastapi/pgstac/stac_fastapi/pgstac/config.py Lines 32 to 33 in 5e1ea82
|
@vincentsarago I tested this fix but it appears that the
|
@alukach you need to set |
It appears that mangum runs ASGI lifecycle events (startup, shutdown etc.) on each lambda function invocation instead of run once and cached. This adds an extra ~200ms of runtime to each invocation and can exhaust available database connections unless lambda is calling through a proxy (ex. RDS Proxy) configured to aggressively drop idle connections.
This seems to fix the problem for pgstac:
The text was updated successfully, but these errors were encountered: