0

I have few lambda functions that are connecting to Mongo Atlas cluster. Connection between Mongo Atlas and my AWS account is done via VPC Peering. Lambda functions are attached to this VPC.

I'm experiencing long cold starts of Lambdas, it's taking around 10 seconds for lambda to respond with VPC, and around 1-2 seconds without VPC. Based on changes that AWS made some time ago (https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/) I shouldn't experience long cold starts.

Screenshots of my config:

lambda vpc config

vpc peering config

vpc config

vpc route table

Is something wrong with my setup?

krzysiexp
  • 13
  • 4
  • What language were you using in lambda? We found Java to be quite slow, the startup time is lower than others but when using libraries like the aws encryption api it loads huge numbers of classes. Java was fast after the first few calls to the same lambda instance, first call about 10s dropping down to 50ms or so later. Python from memory was much faster at about 3s initial but wasn't quite as fast as Java once it warmed up. As for the networking, I didn't really look as I would look at language issues first. – Tim Dec 04 '21 at 20:27

1 Answers1

0

We didn't find solution for that. To workaround that we've disabled VPC peering in Atlas.

krzysiexp
  • 13
  • 4