> ## Documentation Index
> Fetch the complete documentation index at: https://cache-pot.thatdevguy.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Benchmarking Cache-Pot: cache-pot bench

> cache-pot bench is a built-in load generator, modeled on redis-benchmark, that reports throughput and latency percentiles per command — and works against real Redis too.

`cache-pot bench` is a load generator built into the same binary as the server, modeled on `redis-benchmark`. It fires a fixed number of requests across a pool of connections and reports throughput and latency percentiles per command — no separate tool to install.

## Quick start

```bash theme={null}
cache-pot bench -n 100000 -c 50 -t SET,GET,INCR
```

```
cache-pot bench — localhost:6379 · 100000 requests · 50 connections · 3-byte values

== SET ==
  100000 requests in 2.410s
  throughput : 41494 req/s
  latency    : p50 0.550ms · p95 1.274ms · p99 1.817ms · max 5.065ms

== GET ==
  100000 requests in 2.836s
  throughput : 35261 req/s
  latency    : p50 0.627ms · p95 2.062ms · p99 3.441ms · max 9.750ms
```

All connections are dialed up front and reused across every test in the run, so the numbers measure the server, not connection setup.

## Flags

<ParamField name="-n" type="int" default="100000">
  Total requests per test.
</ParamField>

<ParamField name="-c" type="int" default="50">
  Number of parallel connections. Requests are distributed evenly across them.
</ParamField>

<ParamField name="-t" type="string" default="PING,SET,GET,INCR">
  Comma-separated list of tests to run. Available: `PING`, `SET`, `GET`, `INCR`, `LPUSH`, `RPUSH`, `HSET`, `SADD`.
</ParamField>

<ParamField name="-d" type="int" default="3">
  Value size in bytes for SET-style tests.
</ParamField>

<ParamField name="--keyspace" type="int" default="10000">
  Number of distinct keys the load is spread across, so runs exercise many keys instead of hammering one.
</ParamField>

<ParamField name="-q" type="flag">
  Quiet mode — print one summary line per test instead of the full report.
</ParamField>

<ParamField name="--addr" type="string" default="localhost:6379">
  Server address. Also read from `CACHEPOT_ADDR`.
</ParamField>

<ParamField name="--auth" type="string" default="">
  Password sent via `AUTH` before benchmarking begins.
</ParamField>

<ParamField name="--tls" type="flag">
  Connect over TLS. Pair with `--tls-cacert` or `--tls-insecure`, same as [`cache-pot cli`](/guides/cli#connecting).
</ParamField>

## Quiet mode

For scripting or CI, `-q` collapses each test to one line:

```bash theme={null}
cache-pot bench -n 50000 -c 20 -q -t SET,GET
```

```
SET         42357 req/s  p50=0.544ms p99=1.550ms
GET         35702 req/s  p50=0.552ms p99=3.089ms
```

## Comparing against real Redis

Because the tool speaks plain RESP, it isn't tied to Cache-Pot — point it at any Redis-compatible server for a like-for-like comparison using the exact same flags:

```bash theme={null}
cache-pot bench --addr localhost:6379 -n 100000 -c 50 -t SET,GET   # Cache-Pot
cache-pot bench --addr localhost:6380 -n 100000 -c 50 -t SET,GET   # Redis, identical run
```

<Tip>
  Run both benchmarks on the same machine, back to back, with nothing else competing for CPU, for numbers that are actually comparable.
</Tip>

<Info>
  Latency percentiles are computed from every individual request's round-trip time within the run, sorted ascending — p50 and p99 are exact, not sampled or estimated.
</Info>
