Skip to main content

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

Published on PyPI as goodput-http. The import package remains goodput.

pip install goodput-http                 # core
pip install "goodput-http[http2]"       # + HTTP/2
pip install "goodput-http[cli]"         # + CLI
pip install "goodput-http[all]"         # everything
import goodput

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 testingDECLARED / SHARED / ISOLATED_FOR_TEST / INFERRED / CUSTOM scope 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


Download files

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

Source Distribution

goodput_http-0.1.1.tar.gz (102.6 kB view details)

Uploaded Source

Built Distribution

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

goodput_http-0.1.1-py3-none-any.whl (73.9 kB view details)

Uploaded Python 3

File details

Details for the file goodput_http-0.1.1.tar.gz.

File metadata

  • Download URL: goodput_http-0.1.1.tar.gz
  • Upload date:
  • Size: 102.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for goodput_http-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c123085b3cc86e538f39688814ea9570ae0585c1c98f8fc0e7f0f87aa19c234f
MD5 82363127d4e38dfb9d732a7b8a69c2bc
BLAKE2b-256 07c96ae0ac502349717689b41c843bbeef353957c1b0851754a1fd8b99e5d19d

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodput_http-0.1.1.tar.gz:

Publisher: publish.yml on alimoradics/goodput

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file goodput_http-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: goodput_http-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 73.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for goodput_http-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6116c54211da0e2c83975cfde1874bee9e4376ad327074676fb4078708142767
MD5 4e6480933b8149d76181b692967657b3
BLAKE2b-256 6397888b6f41bbef81b427362878a1c6484ae7c22f0c7fa3fe7b9785b77f36d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodput_http-0.1.1-py3-none-any.whl:

Publisher: publish.yml on alimoradics/goodput

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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