BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News AWS Lambda Managed Instances: Serverless Flexibility Meets EC2 Cost Models

AWS Lambda Managed Instances: Serverless Flexibility Meets EC2 Cost Models

Listen to this article -  0:00

AWS Lambda Managed Instances is a new capability that allows customers to run AWS Lambda functions on their Amazon Elastic Compute Cloud (Amazon EC2) instances.

According to the company, the new capability enables access to specialized compute options and cost optimization for steady-state workloads without sacrificing the serverless development experience.

Micah Walter, a Senior Solution Architect at AWS, explains:

You can use Lambda Managed Instances to define how your Lambda functions run on EC2 instances. Amazon Web Services (AWS) handles the setup and management of these instances in your account. You get access to the latest generation of Amazon EC2 instances, and AWS handles all the operational complexity—instance lifecycle management, OS patching, load balancing, and auto scaling.

Under the hood, AWS Lambda Managed Instances utilize capacity providers to organize EC2 instances based on specific compute characteristics such as instance type and scaling parameters, configured via the Lambda console or IaC tools.

With this setup, efficient resource utilization is ensured by routing requests to preprovisioned execution environments, thereby minimizing cold starts and enabling multiconcurrency. Moreover, during traffic spikes, AWS automatically scales by launching new instances. At the same time, built-in safeguards prevent resources from being overwhelmed, maintaining a serverless operational model with no manual configuration or instance management.

Lambda Managed Instances Console

(Source: AWS News Blog)

With AWS Lambda Managed Instances, each execution environment can handle multiple requests simultaneously, reducing compute consumption by sharing resources. Moreover, with Lambda Managed Instances, users can access Amazon EC2 pricing models, such as Savings Plans and Reserved Instances, which offer up to a 72% discount compared to On-Demand pricing.

Luc van Donkersgoed, an AWS Serverless Hero, noted on LinkedIn:

This is an insane crossover between Lambda and EC2 - you can now select EC2 instances to host your Lambda Functions, giving you access to specific CPUs and cost savings plans. But be aware: this is for steady workloads!

However, a respondent on a Reddit thread discusses the cost calculation complexity:

15% of on-demand pricing for AWS to manage your instance, but you can save costs IF you rewrite code to handle multiconcurrency and no charge for duration. So longer-running lambdas see a better ROI. This seems like I need NASA to compute pricing to see if this would save money over just hosting on our own EC2s.

AWS competitors also offer Function-as-a-Service (FaaS) offerings, such as Azure Functions and Google Cloud Functions, which offer various compute options. Jelmer Cormont noted on LinkedIn:

I wonder why MS Azure marketing is so bad that people never go like, WAIT, this has been around as Azure Functions on dedicated App Service Plans since 2016! (because it has)

Lastly, Users can leverage Lambda Managed Instances through the Lambda console, the AWS CLI, or AWS SDKs (supporting the latest versions of Node.js, Java, .NET, and Python runtimes). They are available in the US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Tokyo), and Europe (Ireland) Regions. 

About the Author

Rate this Article

Adoption
Style

BT