← Back to ProtoMQ

Benchmarking Suite

A comprehensive, modular stress-testing suite designed for high-performance MQTT brokers. Developed in Python with uv, it validates latency, concurrency, and stability thresholds.

Source Code 7 Automated Scenarios

Agnostic Stress Testing

The ProtoMQ Benchmarking Suite was built with a critical realization: performance validation is universal. While developed alongside ProtoMQ, the suite is entirely decoupled from the server implementation.

It uses standard MQTT protocols to interact with any broker, making it a valuable tool for testing any MQTT implementation (Mosquitto, EMQX, Vernemq, etc.) against the same rigorous scenarios used to optimize ProtoMQ.

The Scenarios (B1 – B7)

Each benchmark targets a specific stress vector, from connection churn to payload size variance.

Modern Python Infrastructure

The suite leverages Python 3.11+ and the uv package manager for lightning-fast environment setup and execution.

Modular Design

A common/ library provides shared logic for connection tracking, resource monitoring (CPU/Memory), and a standardized BenchmarkRunner. This allows new scenarios to be added by writing only the logic for the specific test case.

Thresholding & Validation

Raw performance numbers are only useful if they can be measured against expectations. The suite includes a sophisticated Thresholding Mechanism that converts bench results into actionable status reports.

Direction-Aware Validation

Every metric is defined with a target "direction" (lower is better for latency, higher is better for throughput). The ThresholdChecker automatically interprets the results based on these semantics.

CI/CD Implementation

Because thresholds are declared in thresholds.json files, the suite is ideal for CI/CD pipelines. A build can be automatically failed if a commit introduces a performance regression, ensuring the "sub-millisecond" promise of ProtoMQ is never broken.

# Examples of threshold definitions
{
    "p99_latency_ms": { "max": 0.8, "warn": 0.6, "direction": "lower" },
    "concurrent_connections": { "min": 9500, "direction": "higher" }
}