RPCBench
Which RPC endpoint is fastest — for this call, from this machine?
A small CLI that compares EVM JSON-RPC over HTTP: latency, P50/P95/P99, error rate, a ranked table, and JSON. Read-only by default. No accounts. No telemetry. Localhost and RFC1918 are allowed (that is how you bench your own node).
It is not a security scanner (Nodeprobe) and not validator monitoring (ValidatorPulse). Split: docs/BOUNDARY.md. Roadmap: issues · epic #19.
Install
pip install rpcbench
Python 3.10+. rpcbench --version prints 0.1.1.
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
PRs run pytest, then a live smoke against PublicNode and dRPC (--samples 1 --warmup 0). No local node in CI; the smoke passes if either public endpoint is ok.
Quick start
rpcbench compare --endpoints https://ethereum.publicnode.com --samples 5 --warmup 1
Or a YAML/JSON file of named endpoints (keep API keys in a local file; do not commit it):
endpoints:
- name: publicnode
url: https://ethereum.publicnode.com
- name: drpc
url: https://eth.drpc.org
- name: paid
url: https://eth.example/v3/YOUR_KEY
bearer: YOUR_TOKEN
headers:
X-Api-Key: YOUR_KEY
rpcbench run --endpoints endpoints.yaml
rpcbench compare --endpoints endpoints.yaml --json
rpcbench run --endpoints endpoints.yaml -o report.json
run and compare are the same command.
Report
The CLI prints, in order:
- Summary — Fastest (P95 by default)
- Comparison — same numbers in your YAML order (failed rows stay in place)
- Ranking — ordered by
--rank-by; failed endpoints last, never Fastest - Providers — redacted URL +
id=hash, samples, errors - Capabilities — who answered this method
On a TTY, ok is green and fail is red (NO_COLOR or a pipe turns color off). Reports never print API keys, bearer tokens, or header values.
How a run works
- Paired by default: one shared read-only sequence; each sample is raced to every provider at the same time.
--sequentialis A-then-B. - Warmup is excluded from min/mean/max, percentiles, and error rate.
- P50/P95/P99 are nearest-rank over successful samples.
- Error rate is failed/attempted, with a class (timeout, connection, HTTP 4xx/5xx, JSON-RPC, malformed).
- Ranking is P95 of successes. Override with
--rank-by p50|p95|p99|mean|rps(throughput=rps). Lower latency wins; higher rps wins. Ties: mean, then config order. - rps is
1000 / mean_msfor this probe — not parallel throughput. - JSON (
--jsonor-o FILE) includesmode,seed,sequence_id, and per-samplepairs(body hashes). Reliabilityscoreis success rate.
Flags
rpcbench run --endpoints endpoints.yaml --samples 10 --warmup 1 --preset head
rpcbench compare --endpoints http://127.0.0.1:8545
rpcbench run --endpoints endpoints.yaml --rank-by p95
rpcbench run --endpoints endpoints.yaml --sequential
rpcbench run --endpoints endpoints.yaml --verbose --json
| Flag | Default | |
|---|---|---|
--samples |
10 | Timed requests per endpoint after warmup |
--warmup |
1 | Requests excluded from stats |
--timeout |
10s | Per-request timeout |
--budget |
128 | Max HTTP requests for the whole run (hard cap RPCBENCH_MAX_REQUESTS, default 10000) |
--max-duration |
600s | Stop remaining work and still print a report (0 = no limit) |
--concurrency |
0 | Paired-wave cap (0 = all providers). Not a load burst |
--seed |
0 | Shared sequence stamp |
--rank-by |
p95 |
p50, p95, p99, mean, or rps |
--preset |
head (eth_blockNumber), chainId, or balance (eth_getBalance of the zero address) |
|
--method / --params |
eth_blockNumber |
JSON-RPC method and JSON array of params. Do not combine --method with --preset |
--allow-writes |
off | Required for write methods (eth_send*, personal_*, …) |
--verbose |
off | Print each sample |
--json / -o FILE |
JSON to stdout, and/or write JSON to a file (table still prints unless --json) |
|
--sequential |
off | Run endpoints back-to-back instead of paired |
Safety
Kill switch: RPCBENCH_DISABLED=1, or create ~/.config/rpcbench/DISABLED (override path with RPCBENCH_DISABLE_FILE). RPCBench never prompts for a private key.
License
Release files for rpcbench 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rpcbench-0.1.1.tar.gz | 32.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rpcbench-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.9 kB
Release files / rpcbench-0.1.1.tar.gz
| Download URL | rpcbench-0.1.1.tar.gz |
|---|---|
| Size | 32.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78d3e0e75a3e501861139ee7ddc5cef503bb79abed25bbf3cc76e75653cdc4d6
|
|
BLAKE2b-256 checksum How to use checksums |
8e5969e1d9b07acf4164afb1e39a7e02b5fc4fbf9d35f74fb2e5486057c166c8
|
| 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 Aug 20, 2026.
Transparency logRelease files / rpcbench-0.1.1-py3-none-any.whl
| Download URL | rpcbench-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
221b1b66d57c5f030f5b5efb20d0a00ddb3399333021b58355af7114ae04a925
|
|
BLAKE2b-256 checksum How to use checksums |
ebdc719a3f6894dc44ee97dc53aef8cfa42992575d99accf1968a3419b61f3bb
|
| 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 Aug 20, 2026.
Transparency log