Repository navigation
Description
Why
We are now publishing measured claims in other projects' repos and on the blog, each tied to a specific workload where KiviDB beats Redis. If a later release loses one of those wins, or breaks one of those apps, the posts become false and we won't notice. Each workload below needs to be a gate: in the release regression suite for performance, and in compat.yml for application correctness.
Published claims so far:
| Where | Claim |
|---|---|
| kividb.io/blog/redis-bgsave-memory-fork; getsentry/self-hosted#4619 | BGSAVE under writes on string data: ~half Redis's peak memory, completes where Redis/Valkey are OOM-killed |
| kividb.io/blog/wordpress-redis-object-cache-slow-under-load-how-to-speed-it-up | WordPress-shaped object cache: 1.4–1.75× GET/SET throughput, 1/3–1/2 median latency at 100 clients; 7–25% less memory for plain strings |
| mastodon/mastodon#41702 | Home-feed fan-out (FeedManager mix): 1.7× at 200 conns, 2.0× at 500; timeline read p50 halved. Stoplight 5.8.3 765/765, sidekiq-scheduler and Sidekiq 8.1.7 on par |
| envoyproxy/ratelimit#1315 | Pipelined INCRBY+EXPIRE: 1.8× at 200 conns, 2.0× at 500 |
| Kong/kong#15068 | rate-limiting plugin EVAL incrby+expire: 1.4× at 200, 1.5× at 500 |
What to add
1. Performance gates (benchmarks/<minor>/regressions, release gate)
Each case runs Redis 8.10.3 (pinned digest, as in compat.yml) and KiviDB on the same VM, and the gate checks the ratio KiviDB/Redis, not absolute numbers, so VM noise cancels out. Suggested floors are ~15% under what we published.
| Case | Load | Gate |
|---|---|---|
bgsave-strings |
~1 GiB of 100 B–8 KB strings, two writer clients, BGSAVE mid-write |
peak RSS ≤ 0.6× Redis's; completes in a 1.5 GiB container where Redis fails |
wp-object-cache |
1M WordPress-style keys, redis-benchmark -c 100 -d 512/2048 -t get,set |
GET ≥ 1.3× Redis at 2 KB; memory ≤ 1.0× |
mastodon-feed-fanout |
20k × 800-member zsets; memtier mix ZSCORE/ZADD/ZREMRANGEBYRANK 0 -801/ZREVRANGE 40 40 WITHSCORES/ZRANGEBYSCORE/EXISTS/ZREVRANGEBYSCORE … LIMIT 0 20, 200 and 500 conns |
≥ 1.5× at 200, ≥ 1.7× at 500; also report memory (#825) |
envoy-ratelimit |
memtier --pipeline 2: INCRBY rl:__key__ 1 + EXPIRE rl:__key__ 60, 100k keys, 200/500 conns |
≥ 1.5× at 200, ≥ 1.7× at 500 |
kong-ratelimit |
memtier EVALSHA of incrby; if first then expire, 100k keys, 200/500 conns (-lua build) |
≥ 1.2× at 200, ≥ 1.3× at 500 |
Report p99 next to each ratio (several of these are worse than Redis at p99 today), and memory, so a "win" that costs 3× the memory is visible (as on lists, #844).
2. Application compatibility (compat.yml, weekly + release)
Run each suite against Redis and KiviDB in the same job; fail if KiviDB has failures Redis doesn't (several suites have environment failures on both):
bolshakov/stoplightv5.8.3 full suite (Mastodon's version): 765/765 on both today.mhenrixon/sidekiq-unique-jobsv8.1.0: Redis 1 failure, KiviDB 6 today (Compat: *SCAN with COUNT 0 errors (Redis returns empty for a missing key); Lua implicit 'arg' in vararg functions missing #820); gate on "no new failures" until Compat: *SCAN with COUNT 0 errors (Redis returns empty for a missing key); Lua implicit 'arg' in vararg functions missing #820 lands, then on parity.sidekiq-scheduler/sidekiq-schedulerv6.0.2: same 5 env failures on both.- Sidekiq 8.1.7 with Mastodon's
config/sidekiq.ymlqueues: all jobs processed at 25–1,000 threads. - Sentry
src/sentry/scripts/spans/add-buffer.luawith real KEYS (<project>:<trace>): same reply types as Redis. - Frappe-style
CLIENT TRACKING ON REDIRECT <id> NOLOOP+__redis__:invalidate. - Rate-limit scripts: Spring Cloud Gateway
request_rate_limiter.lua, Traefik token bucket (HGETALLfield order, see Redis rate limiter never limits when HGETALL returns fields in different order traefik/traefik#14297), Kong increment: identical results to Redis.
Gotchas from running these by hand: the Ruby suites hardcode localhost:6379 in places, so run the test container in the server's network namespace (--network container:<server>); memtier's --command-key-pattern must follow a --command.
All the scripts used are in the outreach notes; I can open a PR with them under benchmarks/ci/ and benchmarks/1.3/regressions/ if useful.
Activity
magic-peach commentedon Nov 17, 2026
@murtazayusuf can i work on this?
murtazayusuf commentedon Nov 17, 2026
@magic-peach thanks, and yes in part. The baselines for these gates have to be recorded on our own benchmark VMs (they become release gates, and the ratios are tied to numbers we've published), so that half stays with us. What would help a lot is the other half: the suite scripts themselves. If you'd like to, take one case to start (
mastodon-feed-fanoutis the most self-contained: it only needs the server, memtier and the command mix in the table) and write it as a suite underbenchmarks/1.3.0/regressions/suites/following that directory's README (how rows are named,jitter()for latency rows, how the Redis comparison is declared), runnable on any machine withrun-all.sh. Leavebaseline.jsonalone; I'll record it from your script and add the gate. Say here which case you take so nobody doubles up. One at a time though: #866 is in review now (I pushed two small things to your branch and am measuring it), and #770 is still yours when the storage question is settled.magic-peach commentedon Nov 17, 2026
@murtazayusuf can I work on this now?
murtazayusuf commentedon Nov 17, 2026
@magic-peach yes, please take the next one. #870 is with us: the suite itself is fine, and what is left is ours (recording its baseline on our benchmark VM against the exact mix behind the published numbers), so nothing more is needed from you there except one rename, below.
Next case:
envoy-ratelimit, the pipelinedINCRBY+EXPIREpair from envoyproxy/ratelimit#1315 (1.8x at 200 connections, 2.0x at 500 are the published ratios the gate protects). It needs only the server, memtier and the two commands, same shape as the Mastodon suite. Two things that bit us and are worth knowing before you write it:__key__placeholder, soINCRBY __key__ 1followed byEXPIRE __key__ 60would hit two different keys. The pair has to land on one key, as the real limiter does: check withredis-cli MONITORon a short run and put a line of that output in the PR.Numbers: suite 17 on master is now
17-set-memory, so please rename #870's to18-mastodon-feed-fanout, and use20-envoy-ratelimitfor the new one (19 is taken by a branch in flight). A separate PR for the new suite, based on master.bench: 20-envoy-ratelimit, envoyproxy/ratelimit's pipelined INCRBY + …
Merge pull request #887 from magic-peach/bench/envoy-ratelimit
bench: 17-mastodon-feed-fanout, Mastodon's home-feed fan-out mix agai…
Merge pull request #870 from magic-peach/bench/mastodon-feed-fanout
magic-peach commentedon Nov 19, 2026
@murtazayusuf #870 and #887 are in. Can I take the next case, kong-ratelimit (memtier EVALSHA of Kong's incrby + first-hit expire script, 100k keys, 200/500 conns, gated at 1.2× / 1.3×)? Same shape as suite 20: one key per pass checked under MONITOR, both servers pinned apart from the client, and baseline.json left to you.
murtazayusuf commentedon Nov 19, 2026
@magic-peach yes, kong-ratelimit is yours. Use number 34 (28 and 32 are taken by open PRs). A few things specific to this one:
Config(..., threads=...)stated as the newer suites do.lua-parallel-scripts on; and in each, one pass with Kong's key as it is and one with a tagged key ({<id>}), since those take different paths in the server. Record all four honestly.EVALSHA: check underMONITORthat every call carries a different key and that the key is in theKEYSposition, not only inARGV.bench: 34-kong-ratelimit, Kong's rate-limiting script against Redis (#…
Merge pull request #951 from magic-peach/bench/kong-ratelimit
Merge pull request #973 from kividbio/bench/published-workload-gates
bench: 39-bgsave-strings and 40-wp-object-cache, the last two publish…
compat: the applications behind the published claims, in compat.yml (k…