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.

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.1.0.tar.gz (73.9 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.1.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lambda_bench-0.1.0.tar.gz
  • Upload date:
  • Size: 73.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 fb8595e1c94c33c7d1ba4ae50e7a080114da94c4c4b1b49f791e05130f7b90d8
MD5 940892c94cae9915b7699ae46a3a9922
BLAKE2b-256 6b55893733007de933e8282381f15fc1fe51950719d48e184a3ef1337d90faf9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lambda_bench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70909dc2d0834623497c2cc24942624d8a152300e019da62adca4a24b9cefb28
MD5 5a89ec20f9ccb6c92f26c3099cf5f6e7
BLAKE2b-256 8977b66d22944435780bf7a4e282ad47602a1d67c09cd12ca8a4d2fd026b2272

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