Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch lambda-sqs-worker template to ARM64 #640

Merged
merged 5 commits into from
Nov 3, 2021

Conversation

etaoins
Copy link
Contributor

@etaoins etaoins commented Nov 3, 2021

These are a bit cheaper and a bit faster than the x86 Lambdas:
https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/

The underlying Lambda architecture should be invisible to typical TypeScript Lambdas. Indirect Apply has switched over all of their Lambdas, only encountering difficulty with DataDog/serverless-plugin-datadog#184.

These are a bit cheaper and a bit faster than the x86 Lambdas:
<https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/>

The underlying Lambda architecture should be invisible to typical
TypeScript Lambdas. Indirect Apply has switched over all of their
Lambdas, only encountering difficulty with
DataDog/serverless-plugin-datadog#184
@etaoins etaoins requested a review from a team as a code owner November 3, 2021 21:22
@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2021

🦋 Changeset detected

Latest commit: 9f56793

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
skuba Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

.changeset/clever-masks-develop.md Outdated Show resolved Hide resolved
.changeset/clever-masks-develop.md Outdated Show resolved Hide resolved
etaoins and others added 2 commits November 4, 2021 08:40
Co-authored-by: Ryan Ling <[email protected]>
Co-authored-by: Ryan Ling <[email protected]>
@etaoins etaoins merged commit 9a73589 into master Nov 3, 2021
@etaoins etaoins deleted the switch-lambda-sqs-template-to-graviton2 branch November 3, 2021 21:49
@github-actions github-actions bot mentioned this pull request Nov 3, 2021
@samchungy
Copy link
Contributor

I think it might be worth leaving a comment somewhere that you should be using arm64 build agents since buildx isn't available on our regular build agents yet

@etaoins
Copy link
Contributor Author

etaoins commented Nov 4, 2021

This doesn't require ARM64 build agents. Serverless uploads a source ZIP, there's no binaries involved.

@samchungy
Copy link
Contributor

However - when we run eg. yarn/yarn install when building dependencies - won't native deps require ARM64 binaries? As I understand the arm64 flag is just for telling AWS Lambda that the bundle contains arm64 deps?

@etaoins
Copy link
Contributor Author

etaoins commented Nov 4, 2021

You can't use native dependencies on the nodejs14.x runtime. It's a special Node environment that's maintained by Amazon and won't execute arbitrary native code.

To include native node deps on Lambda, you'd need to use something like SAM to build a Docker image:
https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-awsother

If you're going to that length, you need to change the runtime anyway so updating the architecture is trivial.

@samchungy
Copy link
Contributor

Gotcha - thanks for the explanation! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants