A Next.js benchmark found ECS fastest for light requests, while Lambda, Lambda Web Functions and Amplify maintained zero errors under higher load; Web Functions delivered the fastest CPU results but cost more.
A hands-on benchmark deployed the same Next.js application to AWS Amplify Hosting, classic AWS Lambda, Lambda Web Functions and Amazon ECS on Fargate in eu-central-1. The tests used one DynamoDB table and measured latency, cold starts, CPU performance, limits and cost.
At 10 requests per second, one 0.5-vCPU ECS Fargate task had the lowest median latency for the server-rendered page, at 29 milliseconds, but it failed on the CPU-heavy endpoint. Lambda, Lambda Web Functions and Amplify completed the comparable light-load tests without errors.
At 200 requests per second, Lambda, Lambda Web Functions and Amplify continued without failed requests in the tested endpoints. The single ECS task reached 100% CPU and produced errors, including 29% errors for the page endpoint; the benchmark notes that a fixed-size ECS service would need more capacity and autoscaling.
Lambda Web Functions had the fastest CPU result among the four runtimes for the 50,000-hash test, with client-side medians of about 96 to 102 milliseconds. The test also found that Web Functions cost about four times as much as classic Lambda in this setup because memory is billed while environments remain active. Amplify imposed an approximately 28-second request limit and a 6 MB response limit, while classic Lambda behind a Function URL also had a 6 MB response limit.