kotless icon indicating copy to clipboard operation
kotless copied to clipboard

Feature Request - Replace Autowarm with Provisioned Concurrency

Open onema opened this issue 5 years ago • 2 comments

Background

Cold starts and Java functions have always been a bad combo.

A scheduled auto warmer does not fully resolve the issue of cold starts. Concurrent calls will still see cold starts despite the warmer, and may only be helpful for functions that seldom get called. Furthermore having an auto warmer on by default is un-expected and in some instances undesirable.

It would be better to replace the Autowarmer with Provisioned Concurrency which is a lambda feature.

Summary of the feature request

  1. Replace the auto warmer with AWS Lambda Provisioned Concurrency
  2. Allow the user to defined the desired level of concurrency
  3. Provisioned Concurrency should be off by default

onema avatar Sep 07 '20 03:09 onema

I believe we can add provisioned concurrency as an option along with autowarming. To be honest, right now we are experimenting with GraalVM and the results are very promising. https://ktor.site.kotless.io takes 3 ms for the cold start. I hope that Kotless would be able to provide simple interface to GraalVM compilation and in that case cold start would not be a problem at all.

TanVD avatar Sep 07 '20 18:09 TanVD

Meanwhile you can disable autowarm manually and add a custom Terraform file https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_provisioned_concurrency_config

EDIT: can't actually use that since the lambda function is not published...

v3rm0n avatar Oct 14 '20 13:10 v3rm0n