skip to Main Content

I have started to write Java Lambdas for some testing and they cold start painfully slowly for the first time (up to 30 seconds, after that it completes in 3 seconds). I read about the new AWS snapstart feature which was released in 2022 but I just can’t enable it for my lambda and I dont see why it is not available for my function. Note that I am not using Spring or Spring boot.
What I can confirm as prerequisites:

  1. Java version 11 (Corretto): I use this version
  2. Must have a published version: I published a new version after creating so this should be fine.

The symptom is that the snapstart configuration options are not available under configuration/General configuration, that section of the screen is empty, something like this:

screenshot

I even tried to check the snapstart status and configuration via the aws CLI (aws lambda get-function-configuration –function-name XXXXXX) and it returns nothing about snapshot, like it doesn’t even exist.
It should show something like this (based on aws documentation) but this section is completely missing from the response:
"SnapStart": {
"ApplyOn": "PublishedVersions",
"OptimizationStatus": "On"
},
"State": "Active"

I thought it might be related to the jar size (40 MB) but I see the same with a small 1 MB image. Anyway, nothing stated on max function size.
Am I missing something here? I even tried to create the lambda via the aws create-function but that rejects with accessdenied complaing about lambda:CreateFunction (which makes no sense, I have given admin rights to the functional account used with aws which has full aws lambda permissions).

2

Answers


  1. Chosen as BEST ANSWER

    As Jarmod also pointed out, the reason for the missing snapstart option was that the London AWS region does not have this capability. It started to work well when I moved the option to Frankfurt. I hope this answer helps to prevent someone else from spending endless hours troubleshooting this. The snapstart documentation page does not mention the limited regional support of this capability.

    btw, I found the root cause from the AWS CLI response when I tried to update the snapstart configuration for my lambda: " SnapStart is not supported in eu-west-2."


  2. It was rolled out into 6 more regions in April, including Asia Pacific (Mumbai), Asia Pacific (Seoul), Canada (Central), Europe (London), South America (São Paulo), US West (N. California). https://aws.amazon.com/about-aws/whats-new/2023/04/aws-lambda-snapstart-java-functions-additional-regions/

    Total region list (as of 4/13/23)

    • US East (N. Virginia)
    • US East (Ohio)
    • US West (N. California)
    • US West (Oregon)
    • Asia Pacific (Mumbai)
    • Asia Pacific (Seoul)
    • Asia Pacific (Singapore)
    • Asia Pacific (Sydney)
    • Asia Pacific (Tokyo)
    • Canada (Central)
    • Europe (Frankfurt)
    • Europe (Ireland)
    • Europe (London)
    • Europe (Stockholm)
    • South America (São Paulo)
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search