Skip to content

How does AWS Amplify handle scaling growing traffic, unexpected load

0

I currently deployed the NextJS by AWS Amplify and am wondering about how does AWS Amplify handles scaling behind the scene. I already know AWS Amplify will deploy the NextJs by AWS Cloudfront and AWS Lamba.

AWS Lambda has a limit on concurrent invocations and concurrent execution, but these are limitation applies on Region - Account level, it doesn't apply for Lambda that hosted by Amplify, is that correct ? So my question is, is there any limit on Lambda hosted by Amplify ? What if there is million request per second hit to Cloudfront and Lambda that hosted by Amplify ?

1 Answer
0

AWS Amplify is designed to handle scaling and growing traffic efficiently, leveraging AWS serverless technologies to automatically scale your application as needed.

When you deploy a NextJS application with AWS Amplify, it indeed uses services like AWS CloudFront and AWS Lambda behind the scenes. However, your understanding about Lambda limitations not applying to Amplify-hosted functions is not entirely correct.

Lambda functions, including those deployed through Amplify, are subject to the same concurrency and scaling limits as other Lambda functions in your AWS account. These limits do apply at the account level within a region, and they affect all Lambda functions, regardless of how they were deployed.

That being said, Lambda has impressive scaling capabilities. Each function can scale up to a rate of 1,000 concurrent executions every 10 seconds, up to your account's concurrency limit. This allows for rapid scaling in response to sudden traffic spikes.

If your application receives millions of requests per second hitting CloudFront and the Lambda functions hosted by Amplify, here's what would happen:

  1. CloudFront would handle the initial load, distributing requests across its global network of edge locations.

  2. The Lambda functions would start scaling up rapidly to handle the increased load, creating new execution environments as fast as the concurrency scaling rate allows.

  3. If the traffic exceeds the Lambda scaling rate or reaches your account's concurrency limit, some requests may be throttled, resulting in errors.

To handle extremely high traffic scenarios, you might need to:

  1. Request a increase in your account's Lambda concurrency limit from AWS support.
  2. Implement caching strategies at the CloudFront level to reduce the load on your Lambda functions.
  3. Consider using provisioned concurrency for your Lambda functions to maintain a set number of pre-initialized execution environments.

Remember, while Amplify provides a seamless development and deployment experience, it's still subject to the underlying AWS service limits. For applications expecting extremely high traffic, it's crucial to design with these limits in mind and implement appropriate scaling and optimization strategies.
Sources
Lambda scaling behavior - AWS Lambda
AWS Lambda functions now scale up to 12X faster in the AWS GovCloud (US) Regions
AWS Amplify | Extensible Web & Mobile Apps | Amazon Web Services

answered 2 years ago

  • To handle extremely high traffic scenarios, you might need to:

    Request a increase in your account's Lambda concurrency limit from AWS support ?

    Is that necessary for this because I don't handle Cloudfront and Lambda that hosted by Amplify.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.