Skip to content

Add stress test for opening many database instances#514

Open
cb1kenobi wants to merge 1 commit intomainfrom
stress-db-instances
Open

Add stress test for opening many database instances#514
cb1kenobi wants to merge 1 commit intomainfrom
stress-db-instances

Conversation

@cb1kenobi
Copy link
Copy Markdown
Contributor

Harper opens a lot of database instances and column families, so this stress test will test this scenario.

stress-test and benchmark were not correctly added to the tsconfig and thus types weren't being enforced. After adding these, I needed to add types to the benchmark setup.ts.

Fixes #473

@cb1kenobi cb1kenobi requested a review from a team April 18, 2026 00:30
@github-actions
Copy link
Copy Markdown
Contributor

📊 Benchmark Results

get-sync.bench.ts

getSync() > random keys - small key size (100 records)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 23.81K ops/sec 42.00 40.66 2,294.26 0.143 119,040
🥈 rocksdb 2 12.36K ops/sec 80.91 78.62 22,222.31 0.870 61,799

getSync() > sequential keys - small key size (100 records)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 27.58K ops/sec 36.26 35.16 606.662 0.103 137,909
🥈 rocksdb 2 12.79K ops/sec 78.21 75.75 609.308 0.054 63,930

ranges.bench.ts

getRange() > small range (100 records, 50 range)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 lmdb 1 25.66K ops/sec 38.96 37.18 1,862.001 0.152 128,324
🥈 rocksdb 2 3.63K ops/sec 275.835 242.257 2,434.099 0.530 18,127

realistic-load.bench.ts

Realistic write load with workers > write variable records with transaction log

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 187.31 ops/sec 5,338.753 65.76 136,945.063 34.37 384
🥈 lmdb 2 26.66 ops/sec 37,515.522 408.735 1,204,104.213 136.736 64.00

transaction-log.bench.ts

Transaction log > read 100 iterators while write log with 100 byte records

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 36.88K ops/sec 27.12 13.99 14,297.519 0.586 184,400
🥈 lmdb 2 440.26 ops/sec 2,271.397 130.933 12,268.179 1.21 2,202

Transaction log > read one entry from random position from log with 1000 100 byte records

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 724.41K ops/sec 1.38 1.20 1,701.813 0.097 3,622,060
🥈 lmdb 2 484.85K ops/sec 2.06 1.09 3,147.631 0.325 2,424,265

worker-put-sync.bench.ts

putSync() > random keys - small key size (100 records, 10 workers)

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 850.45 ops/sec 1,175.848 994.683 1,931.907 0.367 1,701
🥈 lmdb 2 1.18 ops/sec 850,852.308 819,038.252 901,773.695 2.11 10.00

worker-transaction-log.bench.ts

Transaction log with workers > write log with 100 byte records

Implementation Rank Operations/sec Mean (ms) Min (ms) Max (ms) RME (%) Samples
🥇 rocksdb 1 18.46K ops/sec 54.17 29.74 583.33 0.503 36,921
🥈 lmdb 2 811.85 ops/sec 1,231.759 90.93 12,878.4 5.53 1,624

Results from commit ee22871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stress test hundreds of database instances

1 participant