AWS Builder Center
Benchmark: Lambda Web Function Frameworks vs Lambda Event API Gateway

Benchmark: Lambda Web Function Frameworks vs Lambda Event API Gateway

In this blog post, I compare different frameworks, API Gateway and Event-based Lambda, and Lambda-Container with Bun HTTP by requests/sec, performance, costs, and set up.

Series: AWS Lambda Webfunctions (3 articles)

  1. 2
    Benchmark: Lambda Web Function Frameworks vs Lambda Event API Gateway This article
Disclaimer: I used AI to correct my language and also to write code for the benchmark. However, the structure and idea are my own.
When it comes to a REST API service in Node.js (Node), many of you probably think of  ExpressJS.  (Express). Indeed, Express is so popular that AWS uses it for the latest announcement of the Web Functions. But did you know Node has a built-in  HTTP module  that can replace Express and serve as an alternative? A big benefit is that it has zero dependencies.
import http from 'node:http';

// Create a local server to receive data from
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
data: 'Hello World!',
}));
});

server.listen(8000);

New Kids on the blocks

 Hono  and  h3  are worth mentioning because they have implemented the  Request/Response  Web standards, and  Bun , a fast runtime and toolkit, also includes a built-in HTTP server.
They all claim to be faster than Express.
But is that true for the new Web Functions? Or is even the default "Event" function with API Gateway the better choice?
Let's find out!

Setup


'c. jolo@Mac
,xNMM. --------
.OMMMMo OS: macOS 27.2
OMMM0, Host: Mac14,5
.;loddo:' loolloddol;. Kernel: 27.2.0
cKMMMMMMMMMMNWMMMMMMMMMM0:
.KMMMMMMMMMMMMMMMMMMMMMMMWd.
XMMMMMMMMMMMMMMMMMMMMMMMX. Shell: /bin/zsh
;MMMMMMMMMMMMMMMMMMMMMMMM: Resolution: 1512x982
:MMMMMMMMMMMMMMMMMMMMMMMM:
.MMMMMMMMMMMMMMMMMMMMMMMMX. WM: Quartz Compositor
kMMMMMMMMMMMMMMMMMMMMMMMMWd. Terminal: tmux
.XMMMMMMMMMMMMMMMMMMMMMMMMMMk CPU: Apple M2 Max
.XMMMMMMMMMMMMMMMMMMMMMMMMK. GPU: Apple M2 Max
kMMMMMMMMMMMMMMMMMMMMMMd
;KMMMMMMMWXXWMMMMMMMk. Memory: 32.00 GiB
.cooc,. .,coo:.

  • Node 24
The benchmark and results can be found  here .

Contestant

  • Node's built-in HTTP server ( node-http ) v24.22.1
  • Express v5.3.0 ( express )
  • Hono v4.13.14 with node-server v2.1.5 ( hono )
  • Bun v1.4.4 ( bun )
  • Classic ARM Lambda ZIP (2048 MB) + HTTP API Gateway ( lambda-apigw )

Bare Metal

First, I was curious how they compare locally.
I've ranked them by concurrency ( c ) and successful RPS (higher is better). Zero errors across all cells. For this benchmark, I've excluded  lambda-apigw .
Rank
Server
c=1 RPS
c=16 RPS
c=64 RPS
p50 @c=64
p95 @c=64
Failures
1
bun-http
23413
81578
90608
0.72 ms
0.92 ms
0
2
hono
21844
64242
64371
1.00 ms
1.12 ms
0
3
node-http
21637
63443
63707
1.01 ms
1.10 ms
0
4
h3
20702
61346
61544
1.06 ms
1.15 ms
0
5
express
18813
53193
53975
1.19 ms
1.34 ms
0
Ping scenario only (bare process, oha runner). 0 errors across all cells.
Notes
  • Bun leads most rows, with the clearest margin on ping and json-1kb at c=64 and on compute-sha256.
  • Ranking uses RPS only; latency order can differ slightly.

Web Functions vs Lambda Containers vs Event Lambda with HTTP API GW

Rank
Server
c=64 RPS
c=1 RPS
p50 @c=64
p95 @c=64
1
hono
929.6
14.3
65.3 ms
86.5 ms
2
node-http
919.6
14.8
65.3 ms
86.5 ms
3
express
913.3
14.4
65.2 ms
92.6 ms
4
h3
909.1
14.5
65.5 ms
91.3 ms
5
bun-http
859.7
13.1
70.0 ms
99.0 ms
6
lambda-apigw
816.1
12.4
74.1 ms
98.9 ms
It shows that Web Functions can serve more requests per second (RPS; higher is better) than traditional event functions. Response time is also faster (lower is better). 0 errors across all 447,120 requests. Hono seems best at handling more requests and delivering faster response times.

Costs

We retrieved evidence of public Frankfurt on-demand pricing on November 2, 2026. These scenarios cover 10 million requests over 30 days:
Graph of Costs by Web and Event Functions

  • Classic assumptions: 2 GB ARM, billed duration of 50 or 500 ms/request. Client WAN latency is not billed as function duration. HTTP API adds $12 per 10 million requests; Function URLs do not add that gateway fee.
  • Rates: Web $0.30/million requests, $0.0000349964/active vCPU-second, $0.0000046334/consumed GB-second; classic $0.20/million requests and $0.0000133334/allocated ARM GB-second; HTTP API $1.20/million in the first tier.
  • Excluded: free tier, discounts, credits, taxes, data transfer, logs, storage, and initialization/background CPU beyond the stated assumptions. Right-sizing classic memory or changing Web residency changes the comparison.

Conclusion

It’s a good idea to replace your backend with the new Web Functions or deploy your Express app to Web Functions instead of using ECS. They not only outperform the current Event Lambda with HTTP API Gateway, but also cost much less and improve the developer experience by finally letting you develop locally without an emulator. When it comes to HTTP servers, Hono performs best. However, using Node's built-in HTTP server is also not a bad choice, since it pulls no dependencies or bundles.
Try out the new Web Function using AWS CDK. I wrote a  Construct  🍻

Series: AWS Lambda Webfunctions (3 articles)

  1. 2
    Benchmark: Lambda Web Function Frameworks vs Lambda Event API Gateway This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article