Skip to content

Commit

Permalink
set node lambda functions limit to 1769MB
Browse files Browse the repository at this point in the history
Ref:
https://www.sentiatechblog.com/aws-re-invent-2020-day-3-optimizing-lambda-cost-with-multi-threading?utm_source=reddit&utm_medium=social&utm_campaign=day3_lambda

And my metrics from deploy optimizations test.
Each test runs 3 times new (deploy) and destroy project stage.
Testing with different memory size of lambda functions.
Showing aggregate time of all 3 cycles.

442 4m36.496s
885 3m25.648s
1769 2m35.374s
3009 2m27.723s

442 4m41.64s
885 2m57.535s
1769 2m51.921s

1769 2m34.116s
3009 2m21.645s
5308 2m24.637s

1769 2m34.116s
3009 2m21.645s

512 3m44.464s
1024 3m1.944s
2048 2m32.52s
4096 2m11.988s

3009 3m27.002s
5308 3m37.171s
7077 3m14.86s
8846 3m2.501s
  • Loading branch information
ianic committed Dec 6, 2021
1 parent a8c2c65 commit 86272ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/controller/setup_stack_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Resources:
Handler: bootstrap
Runtime: provided.al2
Timeout: 900
MemorySize: 512
MemorySize: 1769
Architectures: ['arm64']
Layers:
- arn:aws:lambda:{{.Region}}:477361877445:layer:terraform-layer:1
Expand Down
6 changes: 3 additions & 3 deletions node/terraform/modules/functions-node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ locals {
"deploy" = {
method = "POST"
s3_key = "${var.functions_path}/deploy.zip"
memory_size = 512
memory_size = 1769
timeout = 900
architecture = "arm64"
layers = ["arn:aws:lambda:${var.region}:477361877445:layer:terraform-layer:1"]
Expand All @@ -12,15 +12,15 @@ locals {
"security" = {
method = "GET"
s3_key = "${var.functions_path}/security.zip"
memory_size = 128
memory_size = 1769
timeout = 900
architecture = "arm64"
policy = data.aws_iam_policy_document.security.json
},
"destroy" = {
method = "POST"
s3_key = "${var.functions_path}/destroy.zip"
memory_size = 512
memory_size = 1769
timeout = 900
architecture = "arm64"
layers = ["arn:aws:lambda:${var.region}:477361877445:layer:terraform-layer:1"]
Expand Down

0 comments on commit 86272ee

Please sign in to comment.