When developers ask whether a modern web application should run on AWS Amplify, AWS Lambda, or Amazon ECS, the standard response is usually a dry feature list. Desperate for hard data rather than theoretical capabilities, one engineer took a single Next.js application and deployed it identically across four distinct AWS runtimes within the exact same account and Region. By pitting classic Lambda against Lambda Web Functions, Amplify Hosting, and ECS Fargate, the benchmark measured the metrics that truly drive production decisions: latency under load, cold start penalties, CPU throughput, actual operational limits, and the monthly bill across varying traffic tiers.

The experiment utilized a single Next.js app router project interacting with a single DynamoDB table. Lambda and ECS ran the exact same container image, while the new Lambda Web Function ingested the identical files packaged within a ZIP archive, and Amplify Hosting compiled the same Git commit. Every command, script, and generated result has been published in an open-source repository to ensure absolute reproducibility.
The setup operated entirely within the Frankfurt Region. Lambda and Fargate were both configured to run on ARM64 Graviton processors at roughly equivalent sizing, utilizing 1024 megabytes of memory alongside half a vCPU for Fargate. The Lambda Web Function enforces a fixed resource profile of two ARM64 vCPUs and two gigabytes of memory, whereas Amplify manages its underlying compute automatically. Fixed infrastructure costs during the testing phase were isolated to the ECS configuration, including the application load balancer, a single Fargate task, and public IPv4 addresses, which totaled approximately $1.90 per day. Meanwhile, Lambda, Amplify, and DynamoDB incurred negligible costs during baseline testing.

Building the application required standardizing the output into a self-contained server package via Next.js standalone mode. For containerized deployments, an enterprise-grade Dockerfile integrated the AWS Lambda Adapter to bridge HTTP traffic, while multi-stage builds ensured proper base image security. During initial testing, automated container registry scans flagged a critical Common Vulnerability and Exposure within the underlying alpine Linux distribution’s zlib package. Implementing a simple base image upgrade step resolved the vulnerability completely, resulting in an optimized 88-megabyte compressed image in Elastic Container Registry.
Deploying the application to classic Lambda involved creating a Function URL, which bypasses the need for an API Gateway and provides a direct, free HTTPS entry point. However, the evaluation exposed a hidden administrative hurdle that frequently catches new accounts off guard: the default account concurrency limit. While AWS documentation suggests a default quota of one thousand concurrent executions, the test account was restricted to just ten. Ten concurrent requests with a response time of roughly one hundred milliseconds equate to a hundred requests per second, meaning any traffic spikes immediately return rate-limiting errors. Following a service quota increase request, the limit was automatically raised to one thousand within a few hours, proving that modern serverless endpoints require far less concurrency than anticipated due to their rapid execution speeds.

The evaluation also put Lambda Web Functions to the test. This newer execution model is designed specifically for web traffic, allowing standard web servers listening on a port to scale down to zero while serving multiple concurrent requests within a single environment, much like a traditional container. Deploying the application required packaging the pre-built files alongside a lightweight routing script to map environment variables correctly. Unlike classic Lambda, Web Functions bill for actual CPU utilization alongside memory duration across the lifecycle of each running environment, meaning idle environments can accrue noticeable baseline costs over time.
For the containerized track, ECS Fargate tasks were deployed behind an application load balancer within public subnets to bypass the prohibitive costs of a NAT gateway. Optimized health checks and rapid deregistration delays ensured that deployments cycled efficiently. Concurrently, Amplify Hosting integrated directly with GitHub, abstracting the infrastructure layer entirely. Because Amplify passes environment variables exclusively during the build phase rather than at runtime, engineers must

explicitly write configuration variables into production environment files during compilation. Furthermore, Amplify introduces a dedicated compute role to ensure server-side code possesses the necessary IAM permissions to query external services like DynamoDB.
When put under rigorous load testing using performance tools, the performance disparities between the runtimes became stark. At light traffic loads of ten requests per second, ECS Fargate emerged as the fastest option for standard server-side rendering and API endpoints because raw container execution introduces zero abstraction layers between the load balancer and the Node.js process. Lambda and Lambda Web Functions trailed closely behind with nearly identical median response times, while Amplify ran roughly fifty percent slower than standard Lambda.

However, the CPU-intensive endpoint revealed significant vulnerabilities in fixed-capacity architectures. A single Fargate task provisioned with half a vCPU completely buckled under a barrage of heavy hashing requests, saturating processing capacity and causing health checks to fail. This triggered an automatic service replacement cycle in the middle of the test, resulting in dropped requests and soaring latency. Conversely, the serverless alternatives absorbed the CPU overload seamlessly by dynamically spinning up additional execution environments. When tested at higher throughputs of two hundred requests per second, Lambda, Web Functions, and Amplify maintained steady performance without a single dropped request, while the single ECS task suffered complete failure under the resource exhaustion.
Cold start measurements highlighted further operational differences. Classic Lambda environments initiated consistently within fractions of a second, whereas Amplify experienced initial latency spikes of up to two seconds following quiet periods. Lambda Web Functions demonstrated reliable startup behavior across newly created revisions, while ECS maintained zero cold-start latency for running tasks, though scaling out new tasks required significantly more time due to container provisioning and health check validation cycles.

Evaluating the financial impact across varying monthly traffic tiers exposed profound differences in cost-efficiency. At lower traffic volumes, serverless models cost mere cents, while ECS incurs a fixed baseline due to the continuous operation of the load balancer and underlying tasks. As traffic scaled into the tens of millions of requests, classic Lambda remained exceptionally economical. Meanwhile, the memory-intensive billing structure of Lambda Web Functions made it substantially more expensive than classic Lambda under sustained load, and Amplify scaling costs rose moderately alongside request volume. Ultimately, the benchmark demonstrates that infrastructure decisions cannot be made on feature lists alone, underscoring the critical necessity of measuring application behavior under production conditions before committing to a runtime architecture.

Comments (0)