Ross Coundon
11/23/2021, 1:56 PMWhen you use Lambda outside VPC, it means a request to DynamoDB will go over the internet which might traverse over multiple ISPs. This leaves room where requests may get lost along the path, this is especially true if the issue is intermittent and error shows timeout exceptions.
It is actually better from a DynamoDB perspective to have your Lambda inside a VPC, this is because the network path becomes predictable, thus more stable. When you have your Lambda inside the VPC, you can make use of DynamoDB's VPC endpoint to access DynamoDB (Lambda -> Lambda ENI - > DDB VPCendpoint -> DDB service). Furthermore, this allows better monitoring, because you will be able to use VPC flow logs to see network traffic and determine if messages are being dropped. Since DNS uses UDP for DNS queries, the packets can get lost along the path (Lambda probably has a retry mechanism for retry DNS queries).
One of the main reasons we moved to DynamoDB was to remove the need for the complexities of VPCs!thdxr
11/23/2021, 1:58 PMthdxr
11/23/2021, 1:58 PMRoss Coundon
11/23/2021, 1:58 PMthdxr
11/23/2021, 1:58 PMRoss Coundon
11/23/2021, 1:59 PMChad (cysense)
11/23/2021, 2:00 PMSeth Geoghegan
11/23/2021, 2:01 PMÖmer Toraman
11/23/2021, 3:56 PMSeth Geoghegan
11/23/2021, 3:57 PMÖmer Toraman
11/23/2021, 3:58 PMMatt Morgan
11/23/2021, 3:58 PMÖmer Toraman
11/23/2021, 3:59 PMthdxr
11/23/2021, 5:04 PMMatt Morgan
11/23/2021, 5:08 PMthdxr
11/23/2021, 5:09 PMRoss Coundon
11/23/2021, 6:27 PMMatt Morgan
11/23/2021, 7:36 PMSeth Geoghegan
11/23/2021, 7:36 PMMatt Morgan
11/23/2021, 7:37 PMthdxr
11/23/2021, 7:39 PMIIRC, that's accurate (that a lambda not in a vpc is hitting ddb over the internet), but I also think I understood that AWS still optimizes the network traffic (internet or not) between two services like that (regardless of region); amazon global backbone yada yada.
[1:10 PM]
Ross Coundon
12/01/2021, 11:00 PMRoss Coundon
12/01/2021, 11:15 PMÖmer Toraman
12/01/2021, 11:30 PMMatt Morgan
12/04/2021, 4:09 PMRoss Coundon
12/04/2021, 5:18 PMMatt Morgan
12/04/2021, 6:20 PMRoss Coundon
12/04/2021, 6:27 PMMatt Morgan
12/04/2021, 6:29 PMRoss Coundon
12/04/2021, 6:30 PMMatt Morgan
12/04/2021, 6:30 PMMatt Morgan
12/04/2021, 6:30 PMMatt Morgan
12/04/2021, 6:31 PMRoss Coundon
12/04/2021, 6:35 PMconst agent = new https.Agent({
maxSockets: 1000,
keepAlive: true,
});
AWS.config.update({
httpOptions: {
timeout: 10_000,
connectTimeout: 5000,
agent,
},
maxRetries: 0,
});
but we've tried all kinds of different values and permutationsMatt Morgan
12/04/2021, 6:37 PMRoss Coundon
12/04/2021, 6:39 PMMatt Morgan
12/04/2021, 6:41 PMRoss Coundon
12/04/2021, 6:43 PMMatt Morgan
12/04/2021, 6:44 PMRoss Coundon
12/04/2021, 6:45 PMMatt Morgan
12/04/2021, 6:46 PMMatt Morgan
12/04/2021, 6:46 PMRoss Coundon
12/04/2021, 10:09 PMRoss Coundon
12/04/2021, 10:09 PMthdxr
12/06/2021, 12:46 AMthdxr
12/06/2021, 12:46 AMMatt Morgan
12/06/2021, 12:51 AMRoss Coundon
12/06/2021, 7:23 AMRoss Coundon
12/06/2021, 7:24 AMMatt Morgan
12/06/2021, 12:16 PMRoss Coundon
12/06/2021, 12:35 PMRoss Coundon
12/06/2021, 12:36 PMMatt Morgan
12/06/2021, 12:37 PMMatt Morgan
12/06/2021, 2:18 PMbatchWrite
? This might be of interest to you. https://github.com/elthrasher/cdk-dynamo-lambda-loader. I wanted to see if I could write a million items in less than a minute (and I could). That reminds me, are you using provisioned or on demand capacity?Ross Coundon
12/06/2021, 2:28 PMRoss Coundon
12/06/2021, 2:30 PMSeth Geoghegan
12/06/2021, 3:27 PMRoss Coundon
12/06/2021, 7:21 PMthdxr
12/06/2021, 7:22 PMSeth Geoghegan
12/06/2021, 8:06 PMMatt Morgan
12/06/2021, 8:38 PMRoss Coundon
12/06/2021, 9:13 PM