Score:0

Lambda with VPC long cold start

in flag

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?

Tim avatar
gp flag
Tim
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.
Score:0
in flag

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.