8000 Lists (300 elements, LPUSH/LTRIM churn): 2.3x Redis data memory, RSS grows to 3.7x (Misskey timelines) · Issue #844 · kividbio/kividb · GitHub
[go: up one dir, main page]

Skip to content

Lists (300 elements, LPUSH/LTRIM churn): 2.3x Redis data memory, RSS grows to 3.7x (Misskey timelines) #844

Closed

Description

@murtazayusuf

Summary

On Misskey's home-timeline workload (Redis lists, LPUSH per follower, LTRIM on 10% of pushes, whole-list LRANGE reads), KiviDB 1.2.2 is faster than Redis 8.10 (1.2–1.4× ops/s, ~30% lower median latency) but uses far more memory:

  • 2.3× the data memory for the 94AB same lists: used_memory 278 MiB vs 119 MiB for 20,000 lists × 300 sixteen-byte members.
  • RSS grows to 3.7× Redis under churn: after ~2 minutes of LPUSH/LTRIM, RSS is 1.24 GiB vs Redis's 0.33 GiB (from 375 MiB vs 128 MiB after the load).

Lists of this length are above the sizes in #297 (10 elements), but Redis's quicklist-of-listpacks stays compact at any length, so the gap persists. The RSS growth under push/trim churn looks like allocator retention (#240?) rather than live data. For Misskey, whose timeline Redis is a separate instance sized by memory, this outweighs the throughput gain.

Tail latency is also worse at low concurrency: p99.9 4.4 ms vs 0.78 ms at 48 connections.

Numbers (two runs per server, each started fresh, same 8-vCPU host)

Redis 8.10.3 KiviDB 1.2.2
used_memory after load 119 MiB 278 MiB
RSS after load 128 MiB 375 MiB
RSS after the runs below 0.33 GiB 1.24 GiB
ops/s, 48 conns 116k 140k
ops/s, 200 conns 107k 150k
ops/s, 500 conns 105k 142k
ops/s, 200 conns, pipeline 16 160k 194k
median / p99 / p99.9, 48 conns 0.40 / 0.65 / 0.78 ms 0.30 / 0.73 / 4.40 ms
median / p99, 500 conns 4.65 / 7.9 ms 3.31 / 8.2 ms

Repro

Load (redis-py): for f in 1..20000: RPUSH list:homeTimeline:u{f} 300 random 16-char [0-9a-z] ids.

Then memtier_benchmark 2.6.1, --threads 4 --clients {12,50,125} --pipeline {1,16} --test-time 30 --data-size 16 --key-prefix=u --key-minimum=1 --key-maximum=20000:

--command='LPUSH list:homeTimeline:__key__ __data__' --command-ratio=10
--command='LTRIM list:homeTimeline:__key__ 0 299'   --command-ratio=1
--command='LRANGE list:homeTimeline:__key__ 0 -1'   --command-ratio=3

This mirrors FanoutTimelineService.push/get in misskey-dev/misskey (packages/backend/src/core/FanoutTimelineService.ts, perUserHomeTimelineCacheMax 300). kividb/kividb:v1.2.2 vs redis:8 (8.10.3, --save ""), AWS CodeBuild linux x86_64. Related: #297, #240, #825.

Activity

  1. murtazayusuf commented on Nov 17, 2026

    @murtazayusuf
    ContributorAuthor

    Lists are now kept in chunks (#895, on master): for lists of this shape the data memory is about half of what is reported here (32-byte elements: 65.2 → 38.4 bytes an element at 100 elements, 36.7 at 3 million, against Redis's 36.4 and 34.3), and a capped list gives its buffers back after LTRIM. Two things in this issue were not re-measured and keep it open: RSS after two minutes of LPUSH/LTRIM churn (allocator retention), and p99.9 at 48 connections. To do: rerun the Misskey mix on master and record all four rows.

  2. murtazayusuf commented on Nov 18, 2026

    @murtazayusuf
    ContributorAuthor

    Re-measured with this issue's load and memtier mix on one Azure D4s_v5 (master b75b064 default release build, Redis 8.10.2 and 1.2.2 on the same VM, server on 2 vCPUs, client on the other 2). Lists are stored in chunks since #895.

    master Redis 8.10.2 1.2.2
    used_memory after load 124 MiB 119 279
    RSS after load 141 MiB 133 384
    used_memory after ~2 min of LPUSH/LTRIM 236 MiB 215 629
    RSS after the churn 315 MiB 255 859
    RSS 15 s after the load stops 263 MiB 250 859

    At 48 connections p99.9 was 4.32 ms (Redis 5.18). On this 4-vCPU box the client was the limit, so throughput was level (about 76-80k ops/s for all three) and the latency row is weak evidence: 1.2.2 did not show the tail gap here either. Closing on the memory rows; reopen if a larger box shows the tail gap again.

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