Score:0

Will using a private VPC for a MongoDB EC2 reduce latency?

in flag

I'm currently using Lambda functions to access an EC2 instance in the same region as the Lambda functions (us-east-1). The EC2 instance is currently accessed via a public domain (e.g, mongodb://services.mydomain.com/etc?ssl=true) with SSL enabled. Any database requests must therefore traverse the public internet.

I'm wondering how much I can expect to reduce latency by putting my Lambdas and the EC2 instance in a VPC and then having the Lambdas access the instance purely via private DNS. I would also remove SSL from MongoDB.

Would a private VPC (and SSL removal) reduce latency notably?

Tim avatar
gp flag
Tim
I guess you have to try it or wait for someone who's done it to tell you for sure - it shouldn't take long other than Mongo config / copying. My guess is turning off SSL will reduce the handshake time and help a bit. The "internet" part might help a little more, but packets probably don't go out to the actual internet, they will stay on the AWS network but take a longer route. Also you'd probably say "In a VPC" rather than behind a VPC, VPC is basically a self contained network.
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.