Skip to content

Commit df2c1dd

Browse files
authored
Docs: Move benchmarking how-to into Development guide
Signed-off-by: Kate Andrews <keandrews@gmail.com>
1 parent 7872732 commit df2c1dd

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

DEVELOPMENT.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,40 @@ Log `debug` output for the `MAPPER` target:
537537
);
538538
```
539539

540+
## Benchmarks
541+
542+
Benchmarking is integrated into CI, and can be run locally.
543+
544+
The benchmark uses `pgbench` to compare direct access to PostgreSQL against `pgbouncer` and Proxy.
545+
Benchmarks are executed in Docker containers, as the focus is on providing a repeatable baseline for performance.
546+
Your mileage may vary when comparing against a "real-world" production configuration.
547+
548+
The benchmarks use the extended protocol option and cover:
549+
- the default `pgbench` transaction
550+
- insert, update & select of plaintext data
551+
- insert, update & select of encrypted data (CipherStash Proxy only)
552+
553+
The benchmark setup includes the database configuration, but does requires access to a CipherStash account environment.
554+
555+
### Required environment variables
556+
```
557+
CS_WORKSPACE_ID
558+
CS_CLIENT_ACCESS_KEY
559+
CS_DEFAULT_KEYSET_ID
560+
CS_CLIENT_ID
561+
CS_CLIENT_KEY
562+
```
563+
564+
### Running the benchmark
565+
566+
```bash
567+
cd tests/benchmark
568+
mise run benchmark
569+
```
570+
571+
Results are graphed in a file called `benchmark-{YmdHM}.png` where `YmdHM` is a generated timestamp.
572+
Detailed results are generated in `csv` format and in the `results` directory.
573+
540574
## Style Guide
541575

542576
### Testing

0 commit comments

Comments
 (0)