8000 Regression gates for the workloads we publish wins on (rate limiters, feed fan-out, WP cache, BGSAVE strings) + app compat suites in compat.yml · Issue #849 · kividbio/kividb · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Regression gates for the workloads we publish wins on (rate limiters, feed fan-out, WP cache, BGSAVE strings) + app compat suites in compat.yml #849

Closed

Description

@murtazayusuf

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):

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

  1. magic-peach commented on Nov 17, 2026

    @magic-peach
    Collaborator

    @murtazayusuf can i work on this?

  2. murtazayusuf commented on Nov 17, 2026

    @murtazayusuf
    ContributorAuthor

    @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-fanout is the most self-contained: it only needs the server, memtier and the command mix in the table) and write it as a suite under benchmarks/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 with run-all.sh. Leave baseline.json alone; 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.

  3. magic-peach commented on Nov 17, 2026

    @magic-peach
    Collaborator

    @murtazayusuf can I work on this now?

  4. murtazayusuf commented on Nov 17, 2026

    @murtazayusuf
    ContributorAuthor

    @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 pipelined INCRBY + EXPIRE pair 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:

    • memtier draws a new key for every __key__ placeholder, so INCRBY __key__ 1 followed by EXPIRE __key__ 60 would hit two different keys. The pair has to land on one key, as the real limiter does: check with redis-cli MONITOR on a short run and put a line of that output in the PR.
    • Report the ratio KiviDB/Redis at each connection count, with both servers given the same number of threads' worth of CPU and the client pinned apart from them; say in the README what the machine was.

    Numbers: suite 17 on master is now 17-set-memory, so please rename #870's to 18-mastodon-feed-fanout, and use 20-envoy-ratelimit for the new one (19 is taken by a branch in flight). A separate PR for the new suite, based on master.

  5. magic-peach commented on Nov 19, 2026

    @magic-peach
    Collaborator

    @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.

  6. murtazayusuf commented on Nov 19, 2026

    @murtazayusuf
    ContributorAuthor

    @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:

    • It needs the Lua build of the candidate and of v1.2.2 (the default build has no scripting), and Config(..., threads=...) stated as the newer suites do.
    • Kong's script takes one key with no hash tag. Please run two configurations: default settings, and 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.
    • The memtier trap from the earlier cases applies doubly with EVALSHA: check under MONITOR that every call carries a different key and that the key is in the KEYS position, not only in ARGV.
    • Gate on the ratio to Redis in the same session, as suite 20 does. If a configuration comes out under the floor you proposed (1.2x / 1.3x), do not lower the floor to make it pass: leave the row as measured and say so in the PR. That number is the thing this suite exists to tell us, and I'd rather know.
    • Baseline stays with us, as before.
  7. added 3 commits that reference this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0