Skip to main content

AWS Lambda cold/warm start benchmarking tool

Project description

lambda-bench

CI PyPI Coverage

Benchmarks AWS Lambda cold and warm start performance across memory tiers and runtimes (Python vs Go). Produces percentile stats, cost-proxy calculations, and publication-ready plots.

[!NOTE] AI Transparency Disclosure: This project utilizes AI coding assistants to generate boilerplates, optimize benchmarks, and refine documentation. All critical logic and performance calculations are human-reviewed and verified.

Example output

Cold start breakdown

Full example run → examples/go-vs-python/

Install

pip install lambda-bench

Or with uv:

uv tool install lambda-bench

Usage

Run a benchmark

lambda-bench run \
  --config functions.json \
  --cold-iters 15 \
  --warm-iters 15 \
  --region ca-west-1 \
  --output-dir results/

Re-plot from saved results (no re-invocation)

lambda-bench plot results/executions.json --output-dir results/plots/

Diff two result files

lambda-bench compare results/before.json results/after.json

Config format

functions.json is a list of function descriptors:

[
  { "label": "Python 512MB", "function_name": "my-func-python", "memory_mb": 512, "variant": "python" },
  { "label": "Go 512MB",     "function_name": "my-func-go",     "memory_mb": 512, "variant": "go"     }
]

IAM policy

The invoking principal needs:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "lambda:InvokeFunction",
        "lambda:UpdateFunctionConfiguration",
        "lambda:GetFunctionConfiguration"
      ],
      "Resource": "arn:aws:lambda:*:*:function:*"
    }
  ]
}

Outputs

File Contents
executions.json Raw Report objects — feed to lambda-bench plot or compare
executions.csv Flat CSV for spreadsheet analysis
plots/*.png Histograms, p50/p95 bars, billed duration vs memory, cost proxy, cold-start breakdown

Development

uv sync --dev
uv run pytest
uv run ruff check src tests
uv run mypy src

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lambda_bench-0.2.0.tar.gz (212.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lambda_bench-0.2.0-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file lambda_bench-0.2.0.tar.gz.

File metadata

  • Download URL: lambda_bench-0.2.0.tar.gz
  • Upload date:
  • Size: 212.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lambda_bench-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5db89443c6e77137b0b95d51dda7b0314dba530584a23c3c2319e165d24ec4e2
MD5 f23b3c1756419388c9f4a6f03f6ee128
BLAKE2b-256 b61924bba48ffeb8464358ceffc90a2aa57d6890ac711606458fb1ba6e6a8790

See more details on using hashes here.

File details

Details for the file lambda_bench-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lambda_bench-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lambda_bench-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef830c1f52211eda933c1156cff29ac8a6fe9e06d62b73278a953c5fb1435fa5
MD5 783ce7646889c64b3d78c12143aa9165
BLAKE2b-256 649d834998137a039dd1c0ace0c5f3b757d1c03f5ef281fbfb3ee5820dc13ed8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page