Skip to content

Commit 31d0788

Browse files
Added extra session caching, RPUSH, and SET benchmarks
1 parent f140ef1 commit 31d0788

3 files changed

+169
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
ersion: 0.4
2+
name: memtier_benchmark-10Kkeys-load-list-rpush-bulkload-pipeline-50
3+
description: |
4+
Runs memtier_benchmark to stress multi-element RPUSH on a single LIST key using
5+
high pipelining and concurrency. This targets quicklist multi-insert behavior and
6+
bulk argument parsing performance (context: Redis PR #13860).
7+
dbconfig:
8+
configuration-parameters:
9+
save: '""'
10+
check:
11+
keyspacelen: 0
12+
resources:
13+
requests:
14+
memory: 1g
15+
tested-groups:
16+
- list
17+
tested-commands:
18+
- rpush
19+
redis-topologies:
20+
- oss-standalone
21+
build-variants:
22+
- gcc:15.2.0-amd64-debian-bookworm-default
23+
- gcc:15.2.0-arm64-debian-bookworm-default
24+
- dockerhub
25+
clientconfig:
26+
run_image: redislabs/memtier_benchmark:edge
27+
tool: memtier_benchmark
28+
arguments: >-
29+
--pipeline 50
30+
--command "RPUSH __key__ a b c d e f g h i j k l m n o p q r s t u v w x y z
31+
aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp qq rr ss tt uu vv ww xx yy zz
32+
ab bc cd de ef fg gh hi ij jk kl lm mn no op pq qr rs st tu uv vw wx xy yz za
33+
ac bd ce df eg fh gi hj ik jl km ln mo np oq pr qs rt su tv uw vx" --distinct-client-seed
34+
--test-time 120 -c 50 -t 4 --hide-histogram --key-minimum=1 --key-maximum 10000
35+
resources:
36+
requests:
37+
cpus: '4'
38+
memory: 2g
39+
priority: 39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.4
2+
name: memtier_benchmark-1Mkeys-load-string-with-1KiB-values-pipeline-10
3+
description: Runs memtier_benchmark, for a keyspace length of 1M keys loading STRINGs
4+
in which the value has a data size of 1000 Bytes.
5+
dbconfig:
6+
configuration-parameters:
7+
save: '""'
8+
check:
9+
keyspacelen: 0
10+
resources:
11+
requests:
12+
memory: 3g
13+
tested-commands:
14+
- set
15+
redis-topologies:
16+
- oss-standalone
17+
build-variants:
18+
- gcc:15.2.0-amd64-debian-bookworm-default
19+
- gcc:15.2.0-arm64-debian-bookworm-default
20+
- dockerhub
21+
clientconfig:
22+
run_image: redislabs/memtier_benchmark:edge
23+
tool: memtier_benchmark
24+
arguments: '--pipeline 10 --distinct-client-seed --data-size 1000 --ratio 1:0 --key-pattern R:R --key-minimum=1 --key-maximum
25+
1000000 --test-time 180 -c 50 -t 4 --hide-histogram'
26+
resources:
27+
requests:
28+
cpus: '4'
29+
memory: 2g
30+
tested-groups:
31+
- string
32+
priority: 17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
version: 0.4
2+
name: memtier_benchmark-session-caching-string-100k-sessions
3+
description: |
4+
Runs memtier_benchmark to simulate a session caching workload for a SaaS application.
5+
This benchmark focuses exclusively on **string-based session storage**, where each session
6+
is stored in Redis as a serialized JSON string (`session:<id>`) containing fields like
7+
user ID, timestamps, device info, and metadata (total ~400–600B).
8+
9+
The benchmark models a typical read-heavy cache usage pattern, with an approximate
10+
**read:write ratio of 80:20**, reflecting session retrievals and infrequent updates.
11+
12+
Command groups:
13+
- Session cache reads (`GET`): ~80%
14+
- Session cache writes (`SET`): ~20%
15+
16+
To better approximate real-world access patterns, the benchmark uses a **Zipfian key distribution**
17+
(`--command-key-pattern=Z`). This simulates **skewed access** where a small subset of sessions (hot keys)
18+
receives a majority of reads — a common pattern in production workloads.
19+
20+
While Zipfian is technically a power-law distribution, it effectively mimics **Poisson-like behavior**
21+
in large-scale systems, where access frequency is uneven but statistically predictable.
22+
This access skew mirrors real-life scenarios such as:
23+
- Frequently accessed or "sticky" user sessions
24+
- Popular user accounts or active devices
25+
- Hot caches for trending or recently used resources
26+
27+
Using Zipfian distribution allows this benchmark to capture **contention**, **cache pressure**, and
28+
**read amplification** effects that occur in real SaaS applications under load.
29+
30+
dbconfig:
31+
configuration-parameters:
32+
save: '""'
33+
resources:
34+
requests:
35+
memory: 1g
36+
init_lua: |
37+
local seed = 12345
38+
math.randomseed(seed)
39+
local now = tonumber(redis.call('TIME')[1])
40+
local function rand_str(len)
41+
local chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
42+
local res = ''
43+
for i = 1, len do
44+
local idx = math.random(#chars)
45+
res = res .. chars:sub(idx, idx)
46+
end
47+
return res
48+
end
49+
for i = 1, 100000 do
50+
local session_id = 'session:' .. i
51+
local session_data = string.format(
52+
'{"userId":"user-%d","organizationId":"org-%d","role":"member","createdAt":"%d","lastAccessed":"%d","ipAddress":"192.168.1.%d","device":"device-%s","authMethod":"password","status":"active","metadata":"%s"}',
53+
i, i, now - math.random(3600), now, (i % 255), rand_str(8), rand_str(200 + (i % 100))
54+
)
55+
redis.call('SET', session_id, session_data)
56+
end
57+
return 'OK'
58+
59+
tested-groups:
60+
- string
61+
62+
tested-commands:
63+
- get
64+
- set
65+
66+
redis-topologies:
67+
- oss-standalone
68+
69+
build-variants:
70+
- gcc:15.2.0-amd64-debian-bookworm-default
71+
- gcc:15.2.0-arm64-debian-bookworm-default
72+
- dockerhub
73+
74+
clientconfig:
75+
run_image: redislabs/memtier_benchmark:edge
76+
tool: memtier_benchmark
77+
arguments: >
78+
--key-prefix ""
79+
--key-minimum 1
80+
--key-maximum 100000
81+
--data-size-range=400-600
82+
--pipeline=1
83+
--print-percentiles=50,90,95,99
84+
--run-count=1
85+
--test-time=120
86+
--command="GET session:__key__"
87+
--command-key-pattern=Z
88+
--command-ratio=90
89+
--command='SET session:__key__ "{\"userId\":\"user-__key__\",\"organizationId\":\"org-__key__\",\"role\":\"member\",\"createdAt\":\"1754905396\",\"lastAccessed\":\"1754906472\",\"ipAddress\":\"192.168.1.36\",\"device\":\"device-2T8YGLbl\",\"authMethod\":\"password\",\"status\":\"active\",\"metadata\":\"wDVmiQsSe2oSEPfhhvYN6jbVxVykSCzQXmnsqCIv5MEmpslD1LMgwJcUe8Wmhvhh56dgTDhH4o3M9vYa6JyAS3Axs2zufVVPWtTsCRVbNGjMmumy7j5vIM0OuclgbHBOxtGDtCU88YBc9IP5oNYiycXXCmq5s7mWAdmRhFrmFxOy3VKlrXJz4ZrtF6KHEflGhoF1FzXtLO8Dckg3B34kdxGsnNiRjNIEtWVxeXekUSDyrxcnwiIy29Zx8SxX2g8ZUrz3sTpEwX7KQZFpIi7XoSKZywvC6I63VMNpZcAO\"}"'
90+
--command-key-pattern=Z
91+
--command-ratio=10
92+
--hide-histogram
93+
resources:
94+
requests:
95+
cpus: '4'
96+
memory: 2g
97+
98+
priority: 150

0 commit comments

Comments
 (0)