AWS Bites Podcast

151. EC2 loves Lambda - Lambda Managed Instances

AWS just made Lambda… less serverless. Lambda Managed Instances (Lambda MI) brings managed EC2 capacity into Lambda, and it changes the rules: environments stay warm, a single environment can handle multiple concurrent invocations, and scaling becomes proactive and asynchronous instead of "spin up on demand when traffic hits."

In this episode of AWS Bites, Eoin and Luciano break down what Lambda MI unlocks (and what it costs): fewer traditional cold starts, but a new world of capacity planning, headroom, and potential throttling during fast spikes. We compare it to Default Lambda, explain how the new scaling signals work, and what "ACTIVE" really means when publishing can take minutes on a new capacity provider.

To make it real, we built a video-processing playground: an API, a CPU-heavy processor, and a Step Functions workflow that scales up before work and back down after. We share the practical lessons, the rough edges (regions, runtimes, mandatory VPC, minimum 2 GB + 1 vCPU, concurrency pitfalls), and the pricing reality: requests + EC2 cost + a 15% management fee.

Big shoutout to fourTheorem for powering another episode of AWS Bites. At fourTheorem, we believe the cloud should be simple, scalable, and cost effective, and we help teams do just that. Whether you are building event-driven systems, scaling a global SaaS on AWS, modernising serverless and container platforms, or trying to keep cloud spend under control, our team has your back. Visit fourTheorem.com to see how we can help you build faster, better, and with more confidence on AWS.

In this episode, we mentioned the following resources:

Let's talk!

Do you agree with our opinions? Do you have interesting AWS questions you'd like us to chat about? Leave a comment on YouTube or connect with us on:

Luciano
00:00:00

Hello and happy 2026. In our latest episode of AWS Bites, we covered ECS managed instances, which is a new way to power your ECS cluster with managed EC2 capacity. This basically means that you still use EC2 instances under the hood, but in this case, AWS takes care of all the usual instance chores like picking the base image, operating system lifecycle, security patching, ongoing maintenance, and you basically focus on describing what you need, for example, if you want a GPU, or maybe if you want specific storage profiles, or maybe particular networking characteristics. And then at that point, AWS provisions the right instance for your cluster in exchange for a management fee. Now, coming straight out of reInvent in Las Vegas, which is AWS's biggest conference of the year, AWS has taken this very idea, managed instances, and applied it to, drumroll, Lambda. So the name of the announcement is Lambda managed instances, and it has been a little bit controversial. It has sparked a lot of curiosity, plus a fair amount of confusion, because let's be honest, why in the world would you want to bring EC2 instances, aka servers, into one of the most serverless compute services out there? So you might be wondering, what does it really change for Lambda? Do you gain something that you could not do before? Honestly, we were as well curious as much excited by this announcement. So we took Lambda MI for a proper test drive during the holidays, and in this episode, we're going to share our take on it. So we want to share what Lambda managed instances enables that default Lambda could not do before. And there are a few spoilers I want to give you here, just to capture your attention. There are no more cold starts, kinda, we'll talk more about that. And a single Lambda environment can now handle multiple requests concurrently, which is also very interesting, and we'll cover that in detail. We'll also talk about how to set it up and make the most out of it. What are the different ways to scale the underlying EC2 capacity, limitations and pitfalls we noticed, and there are quite a few of them to be aware of. The use cases, when we think this is actually a good fit and a good idea to use this new technology. And of course, we'll talk about pricing and whether it's worth the cost and the effort. Now, since we built a realistic application for this exercise, we'll also talk about our use case and our example application as well. My name is Luciano and I'm joined by Eoin, and this is AWS Bites. AWS Bites is brought to you by fourTheorem. Stay tuned to hear more about fourTheorem at the end of the show. So, Eoin, maybe we should start by clarifying again, what is the difference between default, I guess we should call them, Lambdas, and Lambda on EC2?

00:04:54

So it's not just Lambda, but on different hardware. There are a few big behavioral changes that will materially affect how your functions perform, how they scale, and how you need to write and operate them. So it's definitely something you need to go into with your mind fully informed on how all these things work. So what changes in practice is, well, for one, the concurrency model. One execution environment can now handle multiple concurrent invocations, unlike default Lambda's single invocation per environment model. This is a big change in how Lambda operates and something that people might have been asking about for a long time. And it reminds us a little bit of Vercel's fluid compute. It also makes Lambda suitable as a back end for high throughput APIs. We've seen people who are familiar with, say, the Node.js ecosystem and how it can handle high concurrency, asynchronous I/O in one process. This is one of the great benefits of Node.js when it came out originally. And then when you move to Lambda, you're wondering, well, I'm losing all of that power now because I can only do one event in a process. But now you can do multiple events per process so you get a little bit more of that benefit back. Other things that have changed with managed instances, now we now have always on environments. So environments can stay continuously active, no freezing between invocations, and this helps to mitigate most of the traditional cold starts. Scaling behavior now is asynchronous and driven by things like CPU utilization.

00:06:20

It doesn't scale to zero because it maintains a configured minimum capacity. And fast traffic ramps can outpace scaling briefly. So you'll need to think about that. And then when you publish a function to run on managed instances, Lambda by default is going to launch three instances, three EC2 instances in your account by default for resiliency. It's good practice. And it'll bring those environments up before making the version active. Now, there are ways, which we might touch on a little bit later on how to avoid there being three instances all the time, but that's just generally a good practice. When we talk about lifecycle as well, the instance lifecycle, these instances will stay up for a maximum of 14 days. That's what Lambda is saying, but then they're going to rotate them. So that's something you should plan for if it's important. And now with this model, you can pick instance characteristics. So you can think about the latest CPUs you want, like Graviton 4, you can get here now. Configurable memory to CPU ratios, if you want high bandwidth networking, which is something you didn't have that much control over before, now you have that option. So these are all new considerations. What stays the same, it's still Lambda in how you build and integrate it. You should treat your code more like a concurrent long lived service process because the execution environment can handle parallel invocations and sticks around. So if you used to, functions that didn't hang around, sandboxes that didn't hang around, these short lived execution environments, you may not have noticed your memory leaks before. Now with these 14 day instances, it might be something you'll have to think about. Should we talk now about how scaling works? I think a little bit more in detail. What do you think?

Help us to make this transcription better! If you find an error, please submit a PR with your corrections.