Skip to main content

K9-Load logo

K9

Load testing with k6's UX, a Rust engine and a Python API.

Status: v0.1 (alpha) (see the changelog). All of k6's executors, checks and thresholds work, from YAML plans or Python scripts, with HTTP/1.1, HTTP/2, HTTP/3, WebSockets and gRPC. Tests scale across cores and machines, send results to k6's outputs, and run inside pytest.

K9 lets you write load tests in Python, with the script shape, executors, checks, thresholds and metric names you know from k6. The part that sends requests and measures time is written in Rust. Python only describes the work, so most tests never pay for the GIL.

# A K9 script: k9 run script.py
import k9

options = {
    "vus": 50,
    "duration": "1m",
    "thresholds": {"http_req_duration": ["p(95)<300"]},
}

async def default():
    res = await k9.http.get("https://test.k6.io/")
    k9.check(res, {"status is 200": lambda r: r.status == 200})

Why another load tester?

k6 Locust Goose K9
Test language JavaScript Python Rust (compiled) Python
Engine Go Python (gevent) Rust Rust
Open-model (arrival-rate) executors ✅ ❌ (closed model) ❌ ✅
Coordinated-omission handling Avoided by arrival-rate executors ❌ ✅ corrected ✅ both
Load tests inside pytest ❌ ❌ ❌ ✅
License AGPL-3.0 MIT Apache-2.0 MIT / Apache-2.0
  • From k6: the script shape, the seven executors, checks, the threshold syntax, metric names and exit code 99. Your Grafana dashboards and CI configs carry over.
  • From Goose: weighted transactions, coordinated-omission correction, live run control and the manager/worker distributed mode.
  • Compared with Locust: Locust is the established Python load tester, and if it serves you well, keep using it. K9 targets cases where the load generator's own overhead or measurement accuracy matters. In Locust the Python process does the HTTP work. In K9 it doesn't. Measured on one machine (docs/benchmarks.md):
    • declarative plans send as many requests/s as oha, or more, and 1.4–1.5× k6's, for the least CPU per request;
    • one Python process gives 3–4× Locust's single process;
    • with --workers, Python scripts give 1.4× Locust's 8 processes at 256 VUs.

How Python is used: three tiers

Tier What runs in Python Cost
1. Declarative Building the plan, before the run Full Rust speed
2. Hooks setup, teardown, vu_init, handle_summary Negligible
3. Iteration functions default() on every iteration Async: one event loop per process. Sync: one thread per VU. Scaled across cores with process workers.

k9 inspect tells you which tier a script runs in.

Quick start

$ pip install k9-load                                # or: uv tool install k9-load
$ k9 new --url http://localhost:3000/health          # a starter script.py for your service
$ k9 run script.py -u 5 -d 10s                       # run it, print k6's summary

Wheels cover Linux, macOS and Windows on Python 3.10 or newer. To build from source, see Development.

k9 new load.yaml writes a declarative plan instead, and k9 convert recording.har turns a browser recording into one.

Documentation

The full docs are at bakirrayan.github.io/k9_load_testing (sources in docs/; uv run --only-group docs mkdocs serve builds them locally):

Page What's in it
Getting started Install, a first test, checks and thresholds, overriding options
Why K9 k6, Locust and Goose compared; the three tiers
Writing tests k9 new starters and k9 convert from HAR recordings
Declarative plans Templates, extractors, feeders, batch, WebSocket and gRPC steps, transactions, k9.plan
Python scripts k9.http, k9.ws, k9.grpc, checks, groups, metrics, hooks, sync VUs, --workers
HTTP, TLS and network HTTP versions, k6's TLS and network options
Running tests The live dashboard, run options, arrival rates, the control API
Results and outputs JSON, CSV, HTML report, Prometheus, InfluxDB, StatsD/Datadog, OpenTelemetry
Scaling out --workers, --agents and execution segments
Library and pytest k9.run() and the pytest plugin
Benchmarks Hot paths, and k9 against k6, oha and Locust

Development

cargo test --workspace                      # Rust tests
uv sync && uv run pytest                    # Python tests (builds the extension)
uv run --only-group docs mkdocs serve            # the docs site, with the landing page

More in docs/development.md: the crate layout, benchmarks and the test server.

License

Dual-licensed under MIT or Apache-2.0, at your option.

Metadata

Release files for k9-load 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k9-load 0.1.0
File Size Uploaded Provenance Actions
k9_load-0.1.0.tar.gz 461.5 kB With provenance Details for k9_load-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for k9-load 0.1.0
File Actions
k9_load-0.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for k9_load-0.1.0-cp310-abi3-win_amd64.whl
k9_load-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for k9_load-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
k9_load-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for k9_load-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
k9_load-0.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for k9_load-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
k9_load-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for k9_load-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 52.3 MB

Release files / k9_load-0.1.0.tar.gz

Download URL k9_load-0.1.0.tar.gz
Size 461.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1c173727a419135840873aa14dff1f318dab8c0248ea7120c153c734256f771c
BLAKE2b-256 checksum
How to use checksums
24fb75408f4e7b006d419510c2e9fd3ccba80cd2dbc101a5e2b106a40a612230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / k9_load-0.1.0-cp310-abi3-win_amd64.whl

Download URL k9_load-0.1.0-cp310-abi3-win_amd64.whl
Size 11.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
63e4993f675c2d3a74ebf7539824f62e691509961731c3d97efc538fb09081bf
BLAKE2b-256 checksum
How to use checksums
fa4e5ea1b9abe7f14392e3ab444437c7c1fb3c9a23eb34fcfbc42342434e0932
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / k9_load-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL k9_load-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 10.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
34c1f67a732e07df42139acffa49bc50578ede00c8897d17b4c64a80eafb1395
BLAKE2b-256 checksum
How to use checksums
0c915007adf3dcbec12e0321872db6e07433975f81e761ce4e00492e59430aa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / k9_load-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL k9_load-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 10.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
66f5cc1e669683857e983b45b2f5ea89191b75244b9df7320a70453019fd5da3
BLAKE2b-256 checksum
How to use checksums
863981cf83a1eb232a185f47cc48405a7dfe70fa699567682753a8edee2376fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / k9_load-0.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL k9_load-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 9.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c84f47efcf9a0952f7cd3f5ebfba9f2104770b9a2489e6aebc0fd5813ef039b8
BLAKE2b-256 checksum
How to use checksums
3596eeb7ea31b9c7ac2cbae67a5fdaecd7274960070112dd1d4c6987405a6b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / k9_load-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL k9_load-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 10.3 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ae69794a77184805be1b7a100bf43d1e704f810ed130dad5db5cf295405a3efb
BLAKE2b-256 checksum
How to use checksums
c7f8f4492ba8822e0c4f0a35485d4642256a6c0c0725ddde8d37868eb8c58f24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for k9-load 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for k9_load-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page