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

ProvisionedConcurrencyConfig for API Gateway not staying warm #1474

Closed
njbmartin opened this issue Apr 30, 2021 · 2 comments
Closed

ProvisionedConcurrencyConfig for API Gateway not staying warm #1474

njbmartin opened this issue Apr 30, 2021 · 2 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@njbmartin
Copy link

Creating ProvisionedConcurrencyConfig for API Gateway does not work as expected. Followed this blog: https://www.pulumi.com/blog/aws-lambda-provisioned-concurrency-no-cold-starts/

Granted, it's for pure lamba functions, but would expect this to work the same?

const fetchSurveyLambda = new aws.lambda.CallbackFunction(
  `${appName}-fetchSurveyLambda`,
  {
    callback: fetchSurvey,
    publish: true,
  }
)
new aws.lambda.ProvisionedConcurrencyConfig(
  `${appName}-fetchSurveyLambda-warmer`,
  {
    functionName: fetchSurveyLambda.name,
    qualifier: fetchSurveyLambda.version,
    provisionedConcurrentExecutions: 2,
  }
)

After 5 minutes of inactivity on the endpoint, it takes at least 5s to warm up, once warm, requests take milliseconds as expected. It never stays warm though.

Expected behavior

The endpoint should always be warm and take ms to respond.

Current behavior

After a period of inactivity on the endpoint, the endpoint takes 5s+ to warm up again.

Steps to reproduce

  1. See example above

Context (Environment)

Affected feature

@njbmartin njbmartin added the kind/bug Some behavior is incorrect or out of spec label Apr 30, 2021
@njbmartin
Copy link
Author

This might be an upstream issue, so I'm raising with AWS Support

@njbmartin
Copy link
Author

Spent a good hour speaking with AWS Support who walked me through some debugging and potential causes for the slow "cold start". It had nothing to do with the lambda instance, but the code. Will create another issue for this as it doesn't seem right that it takes a few seconds to initialise aws.sdk.DynamoDB.DocumentClient();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

1 participant