tRPCttRPC
Powered by
swammerS
tRPC•2y ago•
5 replies
swammer

Lambda container reuse

In high traffic environments lambda reuses the same container to serve multiple requests. The lambda adapter appears to create a new Context inside the handler for each request. Is there any way to keep things like database connections and s3 clients in the global scope outside of the handler? We sometimes see lambdas fail due to running out of file descriptors when many connections are spawned from the same container.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Lambda WITHOUT API Gateway (Lambda Function URL)
Han MoosHHan Moos / ❓-help
3y ago
Type errors in lambda integration
ortonomyOortonomy / ❓-help
3y ago
trpc + AWS Lambda (through cdk)
ferdyFferdy / ❓-help
3y ago