Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deep dive into AWS Lambda Managed Instances at ...

Deep dive into AWS Lambda Managed Instances at AWS Community Day DACH 2026

AWS Lambda Managed Instances enables us to run functions on a wide range of EC2 instances while maintaining Lambda's operational simplicity.
In this talk, I will explain what problems do AWS Lambda Managed Instances solve, what limitations do they currently have, and how to create them. I'll also compare them with the Lambda default compute type and provide some recommendations on when to use each Lambda compute type.

Avatar for Vadym Kazulkin

Vadym Kazulkin

October 11, 2026

More Decks by Vadym Kazulkin

Other Decks in Technology

Transcript

  1. Contact Vadym Kazulkin ip.labs GmbH Bonn, Germany Co-Organizer of the

    Java User Group Bonn [email protected] https://vkazulkin.com https://www.linkedin.com/in/vadymkazulkin @VKazulkin https://dev.to/vkazulkin https://github.com/Vadym79/ https://de.slideshare.net/VadymKazulkin/ https://www.iplabs.de/
  2. Usual complaints about AWS Lambda ▪ Expensive at a certain

    scale ▪ Starting from 18- 30 requests per second, more expensive than Fargate ▪ No real savings plans or reserved instances applicable ▪ Waste of resources ▪ CPU cycles when waiting for I/O ▪ Single request per execution environment at a time ▪ High cold start times for certain runtimes, even Lambda SnapStart ▪ Java, .NET https://fortem.dev/blog/fargate-vs-lambda/ https://medium.com/life-at-apollo-division/compare-the-cost-of-aws-lambda-fargate-and-ec2-for-your-workloads-ad112c4740fb
  3. Usual complaints about AWS Lambda ▪ No access to the

    specialized hardware ▪ Select memory and get vCPU proportionally ▪ Until recently, no chance to configure network bandwidth https://aws.amazon.com/about-aws/whats-new/2026/08/aws-lambda-network-bandwidth/
  4. Key capabilities of Lambda Managed Instances (LMI) ▪ Choose suitable

    instances ▪ LMI provide access to Amazon EC2 commitment-based pricing models such as Compute Savings Plans and Reserved Instances. ▪ Access specialized compute options ▪ Including Graviton4, network-optimized instances, and other specialized compute options. ▪ Preserve serverless (fully managed) development experience ▪ Without managing instance lifecycles, operating system and language runtime patching, routing, or load balancing https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html
  5. When to use Lambda Managed Instances ▪ High-volume, predictable workloads

    ▪ Best suited for steady-state (high-volume) workloads without unexpected traffic spikes. ▪ Performance-critical applications ▪ Access to the latest CPUs, varying memory-CPU ratios, and high network throughput. ▪ Regulatory requirements ▪ Granular governance needs with control over VPC and instance placement. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-1-introduction-and-sample-application/
  6. Demo application ▪ PUT https://{YOUR_API_GATEWAY_URL}/prod /products/ ▪ GET https://{YOUR_API_GATEWAY_URL}/prod /products/

    {productId} https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-1-introduction-and-sample-application/ https://github.com/Vadym79/aws-lambda-java-25/tree/main/aws-lambda-java-25-lmi
  7. Capacity Provider Lambda Managed Instances use capacity providers as the

    foundation for running your functions: ▪ Create a capacity provider ▪ Define where your functions run by specifying VPC configuration and, optionally, instance requirements and scaling configuration. ▪ Create your function ▪ Create Lambda functions as usual and attach them to a capacity provider. ▪ Publish a function version ▪ Function versions become active on capacity provider instances once published. AWS SAM does it automatically when deploying or updating your stack. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-2-create-capacity-provider/
  8. Create New Capacity Provider / Instance configuration MaxVCpuCount value (default

    is 400) ▪ Defines the maximum number of vCPUs for the capacity provider. This ensures that the bill remains under our control in case wild autoscaling happens. ▪ We can’t set a very small value because it should match the vCPU count of the allowed instances, which will be launched in the defined availability zones. 16 seems to be the lowest value currently. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-2-create-capacity-provider/
  9. Lambda Managed Instances Create Lambda Function with configured EC2 capacity

    provider https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-2-create-capacity-provider/
  10. Create Lambda Function With EC2 Capacity Provider The following runtimes

    currently support Lambda Managed Instances: ▪ Java ▪ Java 21 and later. ▪ Python ▪ Python 3.13 and later. ▪ Node.js ▪ Node.js 22 and later. ▪ .NET ▪ NET 8 and later. ▪ Rust: ▪ Supported using the OS-only runtime provided.al2023 and later. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-3-create-lambda-function-with-lmi-compute-type/
  11. Create Lambda Function With EC2 Capacity Provider CapacityProviderConfig that we

    can set: • Arn defines the Amazon Resource Name of the existing capacity provider. • ExecutionEnvironmentMemoryGiBPerVCpu defines the amount of memory in GiB allocated per vCPU for execution environments. • Memory size - set memory between 2 and 32 GB https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-3-create-lambda-function-with-lmi-compute-type/
  12. Create Lambda Function With EC2 Capacity Provider PerExecutionEnvironmentMaxConcurrency defines the

    maximum number of concurrent execution environments that can run on each compute instance. Language-specific default values: Java and .NET - 32, Python - 16, Node.js - 64, Rust - 8. You can override those values. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-3-create-lambda-function-with-lmi-compute-type/
  13. Create Lambda Function With EC2 Capacity Provider FunctionScalingConfig defines the

    scaling behavior for a Lambda Managed Instances function, including the minimum and maximum number of execution environments (EC2 instances) that can be provisioned. The valid ranges for MinExecutionEnvironments and MaxExecutionEnvironments are between 0 and 15000. Setting both to 0 deactivates the Lambda function, and you don‘t pay for it. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-3-create-lambda-function-with-lmi-compute-type/
  14. Capacity Provider Monitoring • Capacity provider CPU utilization • Capacity

    provider memory utilization • Capacity provider allocated utilization • Execution environment CPU utilization per function • Execution environment memory utilization per function • Execution environment count per function • Capacity provider instance counts https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-4-monitoring-unsupported-features-challenges-and-pricing/
  15. Lambda Managed Instances – Unsupported Features These Lambda features, which

    we know from the default Lambda, are currently unsupported: ▪ SnapStart ▪ Provisioned concurrency ▪ Reserved concurrency https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-4-monitoring-unsupported-features-challenges-and-pricing/
  16. Lambda Managed Instances – Unsupported Instance Types Currently, not all

    instance types are supported: ▪ No GPU support. ▪ No t-family (t3, t4g) support. ▪ For a list of supported instance types, go to the AWS Lambda Pricing page and select your AWS Region. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-4-monitoring-unsupported-features-challenges-and-pricing/
  17. Lambda Managed Instances – Current Challenges Current challenges include: ▪

    It’s not possible to switch between the default Lambda and Lambda Managed Instances. ▪ Due to different concurrency models. ▪ It’s not trivial to cost-effectively set up Lambda with the LMI compute type for staging and test environments with low consumption or for test purposes only. ▪ Set min and max execution environments to 0. When starting to use LMI, reset values. After the end of usage back to 0s. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-4-monitoring-unsupported-features-challenges-and-pricing/
  18. Lambda Managed Instances – Scaling Key differences between default Lambda

    and LMI: ▪ Lambda (default): Scales when there is no free execution environment to handle an incoming invocation (cold start). ▪ Lambda Managed Instances: Scales asynchronously based on CPU resource utilization and multi-concurrency saturation of execution environments ▪ If your traffic more than doubles within 5 minutes, you might see throttles as Lambda scales up instances and execution environments to meet demand. ▪ „No“ cold starts happening https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances-scaling.html
  19. Default Lambda– Scaling Quota Description Value Adjus Mitigation table Concurrent

    executions/ Concurrency limit The maximum number of events that functions can process simultaneously in the current region 1.000 Rearchitect Burst Concurrency Limit After the initial burst, concurrency scales by 1000 executions every 10 seconds up to your account concurrency limit. Each function within an account now scales independently from each other • US West (Oregon), US East (N. Virginia), Europe (Ireland)=3.000 • Asia Pacific (Tokyo), Europe (Frankfurt), US East (Ohio)=1000 • All other Regions=500 Use provisioned concurrency
  20. Lambda Managed Instances – Cold Start The use of LMI

    eliminates the following initializations: • Lambda extension (if you have it) • Execution runtime (in our case, JVM startup with Java 25 version) • Lambda function initialization because EC2 instances are preprovisioned asynchronously https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-5-lambda-function-initial-performance-measurements/ https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-6-lambda-function-performance-improvement-approaches/
  21. Lambda Managed Instances – Cold Start Up to 1.4 seconds

    duration for the first request on the fresh EC2 instance in LMI https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-5-lambda-function-initial-performance-measurements/ https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-6-lambda-function-performance-improvement-approaches/
  22. Lambda Managed Instances – Cold Start Up to 80 milliseconds

    duration for the first request on the fresh EC2 instance in LMI https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-5-lambda-function-initial-performance-measurements/ https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-6-lambda-function-performance-improvement-approaches/
  23. Lambda Managed Instances – Pricing Lambda Managed Instances pricing has

    three components: 1. Request charges: $0.20 per million requests. 2. EC2 instance charges: Standard EC2 instance pricing applies for the instances provisioned in your capacity provider. You can reduce costs by using Compute Savings Plans, Reserved Instances, or other EC2 pricing options3. Compute management fee: 15% on top of the EC2 on-demand instance price for the instances provisioned and managed by Lambda. Functions with LMI will not pay separately for the execution duration of each request, unlike Lambda (default) functions. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-4-monitoring-unsupported-features-challenges-and-pricing/
  24. When to use Lambda Managed Instances - Reminder ▪ High-volume,

    predictable workloads ▪ Best suited for steady-state (high-volume) workloads without unexpected traffic spikes. ▪ Performance-critical applications ▪ Access to the latest CPUs, varying memory-CPU ratios, and high network throughput. ▪ Regulatory requirements ▪ Granular governance needs with control over VPC and instance placement. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-1-introduction-and-sample-application/
  25. When to use Lambda Managed Instances ▪ When you started

    with the default Lambda and outgrew it ▪ You can easily switch to LMI by making changes only to IaC. ▪ Your business logic (in the Lambda functions) remains unchanged. ▪ Watch out for concurrency bugs due to the different concurrency model. https://vkazulkin.com/aws-lambda-managed-instances-with-java-25-and-aws-sam-part-1-introduction-and-sample-application/