I recently modified my VPC configuration, and now I’m experiencing significant performance issues with my Lambda functions. Here’s my current setup:
VPC Configuration:
-
4 subnets total:
-
3 subnets (eu-central-1a, eu-central-1b, eu-central-1c) connected to a route table with:
-
Internet Gateway (IGW) for public internet access
-
VPC Endpoint (VPCE) for S3 access
-
-
1 additional public subnet (in eu-central-1a) connected to a separate route table with the same network connections
-
-
Lambda Function:
My Lambda function performs the following tasks:
- Connects to a database
- Reads a CSV file from S3
- Performs calculations
- Writes results back to the database
Issue:
After the VPC changes, I’m noticing severe performance degradation:
Connections to S3 and the database are taking anywhere from a few seconds to over 2 minutes
This is causing other functions to fail due to timeouts
Logs show that the connection times are highly variable and unpredictable. I’m not certain if this is related to the VPC changes or if there’s another underlying issue.
Questions:
What could be causing these slow connection times within my VPC?
Are there any specific VPC configurations or best practices I should check to improve Lambda performance?
How can I diagnose if this is a networking issue or something else?
Any insights or suggestions would be greatly appreciated. Thank you!