redis-benchmarks-specification 0.1.306__py3-none-any.whl → 0.1.308__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of redis-benchmarks-specification might be problematic. Click here for more details.

@@ -0,0 +1,107 @@
1
+ version: 0.4
2
+ name: memtier_benchmark-session-caching-hash-100k-sessions
3
+ description: |
4
+ Runs memtier_benchmark to simulate a session caching workload for a SaaS application.
5
+ This benchmark focuses exclusively on hash-based session storage, where each session
6
+ is stored in a Redis hash (`session:<id>`) with fields like user ID, timestamps, device info,
7
+ 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 90:10**, reflecting session retrievals and infrequent updates.
11
+
12
+ Command groups:
13
+ - Session cache reads (`HGETALL`): ~90%
14
+ - Session cache writes (`HSET`): ~10%
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
+
31
+ dbconfig:
32
+ configuration-parameters:
33
+ save: '""'
34
+ resources:
35
+ requests:
36
+ memory: 1g
37
+ init_lua: |
38
+ local seed = 12345
39
+ math.randomseed(seed)
40
+ local now = tonumber(redis.call('TIME')[1])
41
+ local function rand_str(len)
42
+ local chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
43
+ local res = ''
44
+ for i = 1, len do
45
+ local idx = math.random(#chars)
46
+ res = res .. chars:sub(idx, idx)
47
+ end
48
+ return res
49
+ end
50
+ for i = 1, 100000 do
51
+ local session_id = 'session:' .. i
52
+ local user_id = 'user-' .. i
53
+ local org_id = 'org-' .. i
54
+ redis.call('HSET', session_id,
55
+ 'userId', user_id,
56
+ 'organizationId', org_id,
57
+ 'role', 'member',
58
+ 'createdAt', tostring(now - math.random(3600)),
59
+ 'lastAccessed', tostring(now),
60
+ 'ipAddress', '192.168.1.' .. (i % 255),
61
+ 'device', 'device-' .. rand_str(8),
62
+ 'authMethod', 'password',
63
+ 'status', 'active',
64
+ 'metadata', rand_str(200 + (i % 100))
65
+ )
66
+ end
67
+ return 'OK'
68
+
69
+ tested-groups:
70
+ - hash
71
+
72
+ tested-commands:
73
+ - hgetall
74
+ - hset
75
+
76
+ redis-topologies:
77
+ - oss-standalone
78
+
79
+ build-variants:
80
+ - gcc:8.5.0-amd64-debian-buster-default
81
+ - dockerhub
82
+
83
+ clientconfig:
84
+ run_image: redislabs/memtier_benchmark:edge
85
+ tool: memtier_benchmark
86
+ arguments: >
87
+ --key-prefix ""
88
+ --key-minimum 1
89
+ --key-maximum 100000
90
+ --data-size-range=400-600
91
+ --pipeline=1
92
+ --print-percentiles=50,90,95,99
93
+ --run-count=1
94
+ --test-time=120
95
+ --command="HGETALL session:__key__"
96
+ --command-key-pattern=Z
97
+ --command-ratio=90
98
+ --command="HSET session:__key__ userId user-__key__ organizationId org-__key__ role admin email user__key__@example.com name \"User __key__\" permissions \"[\\\"read\\\",\\\"write\\\"]\" lastActivity __key__ ipAddress 192.168.1.__key__ userAgent \"Mozilla/5.0\" createdAt __key__"
99
+ --command-key-pattern=Z
100
+ --command-ratio=10
101
+ --hide-histogram
102
+ resources:
103
+ requests:
104
+ cpus: '4'
105
+ memory: 2g
106
+
107
+ priority: 150
@@ -1,5 +1,5 @@
1
1
  version: 0.4
2
- name: memtier_benchmark-playbook-session-storage
2
+ name: memtier_benchmark-playbook-session-storage-100k-sessions
3
3
  description: |
4
4
  Runs memtier_benchmark to simulate a session-based SaaS application.
5
5
  The workload mimics user session CRUD, session tracking, organization-level analytics,
@@ -0,0 +1,203 @@
1
+ version: 0.4
2
+ name: memtier_benchmark-playbook-session-storage-1k-sessions
3
+ description: |
4
+ Runs memtier_benchmark to simulate a session-based SaaS application.
5
+ The workload mimics user session CRUD, session tracking, organization-level analytics,
6
+ and rate limiting. It includes realistic key sizes and command mixes representative
7
+ of production traffic (e.g., 400–600B session hashes, ZSETs for analytics, and SETs for tracking).
8
+
9
+ Rate limiting is modeled using an atomic Lua script, inspired by the Upstash Redis example:
10
+ https://github.com/upstash/examples/tree/main/examples/ratelimit-with-redis
11
+
12
+ Each user has a dedicated key in the form of `ratelimit:user-<id>:/api/resource`, which is
13
+ used to track usage under a fixed window. The logic is evaluated atomically with the following script:
14
+
15
+ local key = KEYS[1]
16
+ local limit = 100
17
+ local window = 60
18
+ local current = redis.call("INCR", key)
19
+ if current == 1 then
20
+ redis.call("EXPIRE", key, window)
21
+ end
22
+ if current > limit then
23
+ return 0
24
+ else
25
+ return 1
26
+ end
27
+
28
+ This ensures that rate enforcement and usage tracking are done without race conditions, and
29
+ mirrors a real-world API quota model.
30
+
31
+ The workload emphasizes read-heavy patterns to reflect common SaaS access behavior. The overall
32
+ **read:write ratio is approximately 85:15**, with read operations covering session access, user-session
33
+ lookups, org analytics, and rate limit enforcement, while writes handle session updates, activity tracking,
34
+ and quota increments.
35
+
36
+ Command groups by use-case (approximate ratio of total operations):
37
+ - Session CRUD (HGETALL, HSET): ~55%
38
+ - User session tracking (SMEMBERS, SADD): ~21%
39
+ - Organization analytics (ZRANGE, ZADD): ~12%
40
+ - Rate limiting (EVAL-based quota check): ~12%
41
+
42
+ exporter:
43
+ redistimeseries:
44
+ break_by:
45
+ - version
46
+ - commit
47
+ timemetric: $."ALL STATS".Runtime."Start time"
48
+ metrics:
49
+ - $."BEST RUN RESULTS".Hgetalls."Ops/sec"
50
+ - $."BEST RUN RESULTS".Hsets."Ops/sec"
51
+ - $."BEST RUN RESULTS".Smemberss."Ops/sec"
52
+ - $."BEST RUN RESULTS".Sadds."Ops/sec"
53
+ - $."BEST RUN RESULTS".Zranges."Ops/sec"
54
+ - $."BEST RUN RESULTS".Zadds."Ops/sec"
55
+ - $."BEST RUN RESULTS".Evals."Ops/sec"
56
+ - $."BEST RUN RESULTS".Totals."Ops/sec"
57
+ - $."BEST RUN RESULTS".Totals."Latency"
58
+ - $."BEST RUN RESULTS".Totals."Misses/sec"
59
+ - $."BEST RUN RESULTS".Totals."Percentile Latencies"."p50.00"
60
+ - $."BEST RUN RESULTS".Totals."Percentile Latencies"."p99.00"
61
+ - $."ALL STATS".Hgetalls."Ops/sec"
62
+ - $."ALL STATS".Hsets."Ops/sec"
63
+ - $."ALL STATS".Smemberss."Ops/sec"
64
+ - $."ALL STATS".Sadds."Ops/sec"
65
+ - $."ALL STATS".Zranges."Ops/sec"
66
+ - $."ALL STATS".Zadds."Ops/sec"
67
+ - $."ALL STATS".Evals."Ops/sec"
68
+ - $."ALL STATS".Totals."Ops/sec"
69
+ - $."ALL STATS".Totals."Latency"
70
+ - $."ALL STATS".Totals."Misses/sec"
71
+ - $."ALL STATS".Hgetalls."Percentile Latencies"."p50.00"
72
+ - $."ALL STATS".Hsets."Percentile Latencies"."p50.00"
73
+ - $."ALL STATS".Smemberss."Percentile Latencies"."p50.00"
74
+ - $."ALL STATS".Sadds."Percentile Latencies"."p50.00"
75
+ - $."ALL STATS".Zranges."Percentile Latencies"."p50.00"
76
+ - $."ALL STATS".Zadds."Percentile Latencies"."p50.00"
77
+ - $."ALL STATS".Evals."Percentile Latencies"."p50.00"
78
+ - $."ALL STATS".Totals."Percentile Latencies"."p50.00"
79
+ - $."ALL STATS".Totals."Percentile Latencies"."p99.00"
80
+
81
+
82
+ dbconfig:
83
+ configuration-parameters:
84
+ save: '""'
85
+ resources:
86
+ requests:
87
+ memory: 1g
88
+ init_lua: |
89
+ -- Use a fixed seed for reproducibility
90
+ local seed = 12345
91
+ math.randomseed(seed)
92
+
93
+ local now = tonumber(redis.call('TIME')[1])
94
+
95
+ local function rand_str(len)
96
+ local chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
97
+ local res = ''
98
+ for i = 1, len do
99
+ local idx = math.random(#chars)
100
+ res = res .. chars:sub(idx, idx)
101
+ end
102
+ return res
103
+ end
104
+
105
+ for i = 1, 1000 do
106
+ local session_id = 'session:' .. i
107
+ local user_id = 'user-' .. i
108
+ local org_id = 'org-' .. i
109
+
110
+ redis.call('HSET', session_id,
111
+ 'userId', user_id,
112
+ 'organizationId', org_id,
113
+ 'role', 'member',
114
+ 'createdAt', tostring(now - math.random(3600)),
115
+ 'lastAccessed', tostring(now),
116
+ 'ipAddress', '192.168.1.' .. (i % 255),
117
+ 'device', 'device-' .. rand_str(8),
118
+ 'authMethod', 'password',
119
+ 'status', 'active',
120
+ 'metadata', rand_str(200 + (i % 100))
121
+ )
122
+
123
+ redis.call('SADD', 'user:' .. i .. ':sessions', session_id)
124
+
125
+ local org_key = 'org:' .. i .. ':sessions'
126
+ for j = 1, 10 do
127
+ local uid = 'user-' .. ((i + j) % 1000 + 1)
128
+ local sid = 'session:' .. ((i + j) % 1000 + 1)
129
+ local zmember = uid .. ':' .. sid
130
+ local zscore = now - math.random(86400)
131
+ redis.call('ZADD', org_key, zscore, zmember)
132
+ end
133
+
134
+ local endpoint = '/api/resource'
135
+ local rate_key = 'ratelimit:' .. user_id .. ':' .. endpoint
136
+ redis.call('INCR', rate_key)
137
+ redis.call('EXPIRE', rate_key, 60)
138
+ end
139
+
140
+ return 'OK'
141
+ tested-groups:
142
+ - hash
143
+ - zset
144
+ - set
145
+ - string
146
+
147
+ tested-commands:
148
+ - hgetall
149
+ - hset
150
+ - smembers
151
+ - sadd
152
+ - zrange
153
+ - zadd
154
+ - incr
155
+ - expire
156
+ - get
157
+
158
+ redis-topologies:
159
+ - oss-standalone
160
+ build-variants:
161
+ - gcc:8.5.0-amd64-debian-buster-default
162
+ - dockerhub
163
+
164
+ clientconfig:
165
+ run_image: redislabs/memtier_benchmark:edge
166
+ tool: memtier_benchmark
167
+ arguments: >
168
+ --key-prefix ""
169
+ --key-minimum 1
170
+ --key-maximum 1000
171
+ --data-size-range=400-600
172
+ --pipeline=1
173
+ --print-percentiles=50,90,95,99
174
+ --run-count=1
175
+ --test-time=120
176
+ --command="HGETALL session:__key__"
177
+ --command-key-pattern=R
178
+ --command-ratio=50
179
+ --command="HSET session:__key__ userId user-__key__ organizationId org-__key__ role admin email user__key__@example.com name "User __key__" permissions "["read","write"]" lastActivity __timestamp__ ipAddress 192.168.1.__key__ userAgent "Mozilla/5.0" createdAt __timestamp__"
180
+ --command-key-pattern=R
181
+ --command-ratio=5
182
+ --command="SMEMBERS user:__key__:sessions"
183
+ --command-key-pattern=R
184
+ --command-ratio=18
185
+ --command="SADD user:__key__:sessions session-__key__"
186
+ --command-key-pattern=R
187
+ --command-ratio=3
188
+ --command="ZRANGE org:__key__:sessions 0 -1 WITHSCORES"
189
+ --command-key-pattern=R
190
+ --command-ratio=10
191
+ --command="ZADD org:__key__:sessions 1 user-__key__:session-__key__"
192
+ --command-key-pattern=R
193
+ --command-ratio=2
194
+ --command='EVAL "local key=KEYS[1];local limit=10;local window=60;local current=redis.call(\"INCR\",key);if current==1 then redis.call(\"EXPIRE\",key,window) end;if current>limit then return 0 else return 1 end" 1 ratelimit:user-__key__:/api/resource'
195
+ --command-key-pattern=R
196
+ --command-ratio=12
197
+ --hide-histogram
198
+ resources:
199
+ requests:
200
+ cpus: '4'
201
+ memory: 2g
202
+
203
+ priority: 150
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redis-benchmarks-specification
3
- Version: 0.1.306
3
+ Version: 0.1.308
4
4
  Summary: The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute.
5
5
  Author: filipecosta90
6
6
  Author-email: filipecosta.90@gmail.com
@@ -271,11 +271,13 @@ redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-pubsub-mixed
271
271
  redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-pubsub-mixed-100-channels-128B-100-publishers-50K-subscribers-5k-conns.yml,sha256=mh_cAomSjsU4WL2l9gt0dhyWdSwfXTrEZgnRz6gzSQE,1144
272
272
  redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-pubsub-publish-1K-channels-10B-no-subscribers.yml,sha256=zwb27Jmg0mwcthbmdUe0KuzqRzAPs7OHcK2gc9-5VBE,779
273
273
  redis_benchmarks_specification/test-suites/memtier_benchmark-nokeys-server-time-pipeline-10.yml,sha256=7G_J8kUFay7jXhZvsZK5jvVHSLZvhMV0uuDMkZBbeSQ,675
274
- redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-storage.yml,sha256=Q5JKvADD1R71hyRx4Qsz5dxHHlYICHqWHD7XTAmX72M,6936
274
+ redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-caching-hash-100k-sessions.yml,sha256=ASQVpVvqwIRFmQYVI8xRf-mvg9nZYYc7ps6259Jb7gk,3600
275
+ redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-storage-100k-sessions.yml,sha256=FNy157KK1Vmru9xervxuu_A9qOqzwrq9iRLUVJRWiRs,6950
276
+ redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-storage-1k-sessions.yml,sha256=W6HnNaVhm6qcoEuwkT1Bv_o9hV0r55W58NLKwtlsjhM,6944
275
277
  redis_benchmarks_specification/test-suites/template.txt,sha256=d_edIE7Sxa5X7I2yG-Io0bPdbDIHR0oWFoCA3XUt_EU,435
276
278
  redis_benchmarks_specification/vector-search-test-suites/vector_db_benchmark_test.yml,sha256=PD7ow-k4Ll2BkhEC3aIqiaCZt8Hc4aJIp96Lw3J3mcI,791
277
- redis_benchmarks_specification-0.1.306.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
278
- redis_benchmarks_specification-0.1.306.dist-info/METADATA,sha256=YXGMeLns9PKM1pTM2AQu_jE5ccwTGApGBMr4Ss-OPJQ,22726
279
- redis_benchmarks_specification-0.1.306.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
280
- redis_benchmarks_specification-0.1.306.dist-info/entry_points.txt,sha256=x5WBXCZsnDRTZxV7SBGmC65L2k-ygdDOxV8vuKN00Nk,715
281
- redis_benchmarks_specification-0.1.306.dist-info/RECORD,,
279
+ redis_benchmarks_specification-0.1.308.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
280
+ redis_benchmarks_specification-0.1.308.dist-info/METADATA,sha256=5Kl4V4DJX8m_yvx_v0LUoXIoDmmE1odbua5XNcgjMEk,22726
281
+ redis_benchmarks_specification-0.1.308.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
282
+ redis_benchmarks_specification-0.1.308.dist-info/entry_points.txt,sha256=x5WBXCZsnDRTZxV7SBGmC65L2k-ygdDOxV8vuKN00Nk,715
283
+ redis_benchmarks_specification-0.1.308.dist-info/RECORD,,