Configuration, benchmarking scripts, and raw data for serverless cold start benchmarks.
MIT License
This repository contains cold start benchmarks for server-side JavaScript applications, executed using different JavaScript runtimes, and deployed via Docker images on AWS Lambda using AWS Lambda Web Adapter. For more information, read our blog post summary.
Results are discussed in the blog post. Raw data is available in the raw_results directory.
Express app:
docker build --rm -t deno_express_app:latest -f docker/deno.dockerfile ./apps/express
docker build --rm -t node_express_app:latest -f docker/node.dockerfile ./apps/express
docker build --rm -t bun_express_app:latest -f docker/bun.dockerfile ./apps/express
Fastify app:
docker build --rm -t deno_fastify_app:latest -f docker/deno.dockerfile ./apps/fastify
docker build --rm -t node_fastify_app:latest -f docker/node.dockerfile ./apps/fastify
docker build --rm -t bun_fastify_app:latest -f docker/bun.dockerfile ./apps/fastify
Hono app:
docker build --rm -t deno_hono_app:latest -f docker/deno.dockerfile ./apps/hono
docker build --rm -t node_hono_app:latest -f docker/node.dockerfile ./apps/hono
docker build --rm -t bun_hono_app:latest -f docker/bun.dockerfile ./apps/hono
Once the Lambda functions are created using the Docker images, you can use the run_benchmark.ts script to run the benchmark for each function. You'll need to provide the function ARN, the function invoke URL, and the number of invocations as arguments.
The script forces a cold start for each iteration, parses Init Duration
from
CloudWatch, and writes the results to stdout in CSV format.
e.g.
./tools/run_benchmark.ts arn:aws:lambda:us-west-2:123456789123:function:express_app_on_deno https://e6mpazwlnt5ykocyq3qcobotp40zdlpr.lambda-url.us-west-2.on.aws 25