An adaptive HTTP execution engine that maximizes sustainable successful logical-request goodput.
Project description
goodput
An adaptive HTTP execution engine that maximizes sustainable successful logical-request goodput.
goodput is a production-grade, async-first Python library for executing very
large volumes of HTTP requests while automatically maximizing the rate of
terminally-successful logical requests — not raw attempt volume. It is a
reusable library first, with an optional CLI, pluggable policies, route/egress
optimization, and a deterministic adaptive control system.
It is not a thin wrapper around asyncio.gather(). The core abstractions —
optimizer authority, logical-request-vs-attempt accounting, bounded scheduling,
route intelligence, and explainable adaptive control — are designed for
high-volume API clients, bulk ingestion, sync/migration, webhook delivery,
load/stress/soak testing, capacity discovery, and authorized throttling
validation.
goodput = terminally successful logical requests completed per unit time. One logical request may take several attempts but counts as exactly one success or failure.
Install
pip install goodput-http # core
pip install "goodput-http[http2]" # + HTTP/2
pip install "goodput-http[cli]" # + CLI
pip install "goodput-http[all]" # everything
Requires Python ≥ 3.10. Core dependencies are minimal: httpx, anyio,
pydantic, pydantic-settings. Everything substantial (HTTP/2, SOCKS, Redis,
OpenTelemetry, Prometheus, Parquet, CLI) is an optional extra.
Quick start
import goodput as gp
result = gp.run_sync(
gp.repeat(gp.Request("GET", "https://example.com/health"), times=1000),
config=gp.EngineConfig(
# The optimizer may tune concurrency within these bounds, and nowhere else.
global_concurrency=gp.bounded_adaptive(minimum=1, maximum=200, initial=10),
),
)
print(result.report.summary())
Async
import goodput as gp
async def main():
async with gp.Engine(config=gp.EngineConfig()) as engine:
run = await engine.run(
gp.repeat(gp.Request("GET", "https://example.com/"), times=10_000)
)
print(run.report.summary())
The big idea: optimizer authority
Every tunable knob declares whether the optimizer may change it — and the
rule is structural, not advisory. A FIXED value can never be mutated.
import goodput as gp
config = gp.EngineConfig(
# Optimizer owns this, within bounds:
global_concurrency=gp.bounded_adaptive(minimum=1, maximum=500, initial=20),
# Optimizer must NEVER change this:
request_rate=gp.fixed(100.0),
)
Control modes (brief §5):
| Mode | Meaning |
|---|---|
fixed(v) |
Exact value; the optimizer must never change it. |
adaptive() |
Optimizer fully owns it (within engine safety ceilings). |
bounded_adaptive(min, max) |
Optimizer owns it only within [min, max]. |
disabled() |
Capability must not be used. |
inherit() |
Value comes from a broader configuration scope. |
When a fixed value causes throttling or poor performance, the engine preserves the fixed value, adjusts only what it is authorized to change, emits a constraint event, and reports the issue — it never silently overrides you.
What it does
- Goodput-first accounting — logical requests vs. attempts vs. retries are always distinct (brief §1, §18).
- Adaptive control — AIMD and latency-gradient concurrency controllers, with every decision recorded and explainable (brief §10).
- Route & egress optimization — direct routes, source-IP binding, HTTP/SOCKS proxies as first-class dimensions; weighted/least-in-flight/goodput-aware selection; health tracking, quarantine, and recovery (brief §11, §12, §20).
- Throttle-scope testing —
DECLARED / SHARED / ISOLATED_FOR_TEST / INFERRED / CUSTOMscope models for authorized validation of whether throttling is correctly scoped (brief §13). - Bounded everything — bounded queues, bounded task creation, bounded memory, streaming percentile statistics, safe cancellation and cleanup (brief §4, §27).
- Resilience — idempotency-aware retries with budgets (no retry storms), circuit breakers, Retry-After / RateLimit header parsing (brief §18, §19, §21).
- Observability — structured events, secret redaction everywhere, sinks (memory / JSONL), and reports that separate every count that matters (brief §23–26).
Authorized use only
This library supports authorized security testing, including testing whether throttling can be bypassed or is incorrectly scoped. It does not grant permission to test any system.
- You must obtain authorization from the target owner.
- You are responsible for legal, contractual, ethical, and regulatory compliance.
- Unauthorized use may be illegal.
- Use explicit scope, ceilings, monitoring, and emergency-stop procedures.
The library deliberately excludes offensive capabilities unrelated to
throughput/throttle testing: credential theft, exploit delivery, CAPTCHA bypass,
stealth/evasion, target discovery, and payload generation. See
SECURITY.md and docs/legal.md.
Documentation
ARCHITECTURE.md— full architecture & design decisions.docs/— concepts, recipes, configuration reference.examples/— runnable examples.
License
Apache-2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goodput_http-0.1.0.tar.gz.
File metadata
- Download URL: goodput_http-0.1.0.tar.gz
- Upload date:
- Size: 98.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586e1722dc61c4f07ad40e790a623127b632e8432a9d7377f0f6dbe7ba7dd2e6
|
|
| MD5 |
e4bf89aaf13949f92751d31abce49929
|
|
| BLAKE2b-256 |
1aee1b3a1efd941cf7bff2b8b4984df807e89496bfddbe253c6a8002878e9a0f
|
Provenance
The following attestation bundles were made for goodput_http-0.1.0.tar.gz:
Publisher:
publish.yml on alimoradics/goodput
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goodput_http-0.1.0.tar.gz -
Subject digest:
586e1722dc61c4f07ad40e790a623127b632e8432a9d7377f0f6dbe7ba7dd2e6 - Sigstore transparency entry: 1852124604
- Sigstore integration time:
-
Permalink:
alimoradics/goodput@f8218a9ac60d3daf2815f29af04ed4e56fd2f7c9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alimoradics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8218a9ac60d3daf2815f29af04ed4e56fd2f7c9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file goodput_http-0.1.0-py3-none-any.whl.
File metadata
- Download URL: goodput_http-0.1.0-py3-none-any.whl
- Upload date:
- Size: 70.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f708a40f67219036af419fe6a8abc8d1b777f83b587cadbc06fb0dd8c262f27
|
|
| MD5 |
ad818f026ac73c9292402f9145d5cb99
|
|
| BLAKE2b-256 |
09b1126ce75daf083c438ba3b96363f6e9007d0827537aca5c4db84baab91f09
|
Provenance
The following attestation bundles were made for goodput_http-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on alimoradics/goodput
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
goodput_http-0.1.0-py3-none-any.whl -
Subject digest:
0f708a40f67219036af419fe6a8abc8d1b777f83b587cadbc06fb0dd8c262f27 - Sigstore transparency entry: 1852124690
- Sigstore integration time:
-
Permalink:
alimoradics/goodput@f8218a9ac60d3daf2815f29af04ed4e56fd2f7c9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/alimoradics
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f8218a9ac60d3daf2815f29af04ed4e56fd2f7c9 -
Trigger Event:
release
-
Statement type: