Skip to content

Commit 908379e

Browse files
committed
Updated geo benchmarks to fully saturate one primary. Include zset benchmarks with long score
1 parent 5991d62 commit 908379e

14 files changed

+450
-186
lines changed

commands-priority.json

+280-166
Large diffs are not rendered by default.

redis_benchmarks_specification/__cli__/args.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def spec_cli_args(parser):
4646
help="Include modules statistics on commandstats.",
4747
)
4848
parser.add_argument("--summary-csv", type=str, default="")
49+
parser.add_argument("--group-csv", type=str, default="")
4950
parser.add_argument("--commands-json-file", type=str, default="./commands.json")
5051
parser.add_argument(
5152
"--commands-priority-file", type=str, default="./commands-priority.json"

redis_benchmarks_specification/__cli__/stats.py

+89-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import redis
66
import oyaml as yaml
7+
import csv
78

89
from redis_benchmarks_specification.__common__.runner import get_benchmark_specs
910

@@ -224,6 +225,24 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
224225
yaml.dump(benchmark_config, file, sort_keys=False, width=100000)
225226
total_tracked_commands_pct = "n/a"
226227

228+
module_names = {
229+
"ft": "redisearch",
230+
"search": "redisearch",
231+
"_ft": "redisearch",
232+
"graph": "redisgraph",
233+
"ts": "redistimeseries",
234+
"timeseries": "redistimeseries",
235+
"json": "redisjson",
236+
"bf": "redisbloom",
237+
"cf": "redisbloom",
238+
"topk": "redisbloom",
239+
"cms": "redisbloom",
240+
"tdigest": "redisbloom",
241+
}
242+
243+
group_usage_calls = {}
244+
group_usage_usecs = {}
245+
227246
if args.commandstats_csv != "":
228247
logging.info(
229248
"Reading commandstats csv {} to determine commands/test coverage".format(
@@ -234,6 +253,7 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
234253

235254
rows = []
236255
priority = {}
256+
priority_usecs = {}
237257

238258
# open file in read mode
239259
total_count = 0
@@ -246,10 +266,13 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
246266
csv_reader = reader(x.replace("\0", "") for x in read_obj)
247267
# Iterate over each row in the csv using reader object
248268
for row in csv_reader:
249-
if len(row) == 0:
269+
if len(row) <= 2:
250270
continue
251271
# row variable is a list that represents a row in csv
252272
cmdstat = row[0]
273+
cmdstat = cmdstat.lower()
274+
if "cmdstat_" not in cmdstat:
275+
continue
253276
cmdstat = cmdstat.replace("cmdstat_", "")
254277
count = int(row[1])
255278
usecs = None
@@ -265,6 +288,15 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
265288
deprecated = False
266289
if "." in cmdstat:
267290
module = True
291+
cmd_module_prefix = cmdstat.split(".")[0]
292+
if cmd_module_prefix in module_names:
293+
group = module_names[cmd_module_prefix]
294+
else:
295+
logging.error(
296+
"command with a module prefix does not have module name {}".format(
297+
cmd_module_prefix
298+
)
299+
)
268300
if cmd in commands_json:
269301
command_json = commands_json[cmd]
270302
group = command_json["group"]
@@ -273,14 +305,35 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
273305

274306
if module is False or include_modules:
275307
priority[cmd.lower()] = count
308+
if type(usecs) == int:
309+
priority_usecs[cmd.lower()] = usecs
276310

277311
if cmdstat in tracked_commands_json:
278312
tracked = True
279313
if module is False or include_modules:
280314
row = [cmdstat, group, count, usecs, tracked, deprecated]
281315
rows.append(row)
316+
if group not in group_usage_calls:
317+
group_usage_calls[group] = {}
318+
group_usage_calls[group]["call"] = 0
319+
if group not in group_usage_usecs:
320+
group_usage_usecs[group] = {}
321+
group_usage_usecs[group]["usecs"] = 0
322+
if type(count) == int:
323+
group_usage_calls[group]["call"] = (
324+
group_usage_calls[group]["call"] + count
325+
)
326+
if type(usecs) == int:
327+
group_usage_usecs[group]["usecs"] = (
328+
group_usage_usecs[group]["usecs"] + usecs
329+
)
330+
if group == "n/a":
331+
logging.warn("Unable to detect group in {}".format(cmd))
282332

283333
priority_list = sorted(((priority[cmd], cmd) for cmd in priority), reverse=True)
334+
priority_list_usecs = sorted(
335+
((priority_usecs[cmd], cmd) for cmd in priority_usecs), reverse=True
336+
)
284337

285338
priority_json = {}
286339
top_10_missing = []
@@ -291,6 +344,16 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
291344
count = x[0]
292345
total_count += count
293346

347+
for group_name, group in group_usage_calls.items():
348+
call = group["call"]
349+
pct = call / total_count
350+
group["pct"] = pct
351+
352+
for group_name, group in group_usage_usecs.items():
353+
usecs = group["usecs"]
354+
pct = usecs / total_usecs
355+
group["pct"] = pct
356+
294357
for pos, x in enumerate(priority_list, 1):
295358
count = x[0]
296359
cmd = x[1]
@@ -315,6 +378,31 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
315378
)
316379
json.dump(priority_json, fd, indent=True)
317380

381+
if args.group_csv != "":
382+
header = [
383+
"group",
384+
"count",
385+
"usecs",
386+
"usec_per_call",
387+
"% count",
388+
"% usecs",
389+
]
390+
with open(args.group_csv, "w", encoding="UTF8", newline="") as f:
391+
writer = csv.writer(f)
392+
393+
# write the header
394+
writer.writerow(header)
395+
for group_name, group_usage_info in group_usage_calls.items():
396+
count = group_usage_info["call"]
397+
call_pct = group_usage_info["pct"]
398+
usecs = group_usage_usecs[group_name]["usecs"]
399+
usecs_pct = group_usage_usecs[group_name]["pct"]
400+
usecs_per_call = usecs / count
401+
402+
writer.writerow(
403+
[group_name, count, usecs, usecs_per_call, call_pct, usecs_pct]
404+
)
405+
318406
if args.summary_csv != "":
319407
header = [
320408
"command",
@@ -326,7 +414,6 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
326414
"% count",
327415
"% usecs",
328416
]
329-
import csv
330417

331418
with open(args.summary_csv, "w", encoding="UTF8", newline="") as f:
332419
writer = csv.writer(f)

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geodist-pipeline-10.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: --pipeline 10 -c 2 -t 2 --command="GEODIST key 1 2" --hide-histogram --test-time 180
24+
arguments: --pipeline 10 -c 50 -t 4 --command="GEODIST key 1 2" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geodist.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: -c 2 -t 2 --command="GEODIST key 1 2" --hide-histogram --test-time 180
24+
arguments: -c 50 -t 4 --command="GEODIST key 1 2" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geohash-pipeline-10.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: --pipeline 10 -c 2 -t 2 --command="GEOHASH key 1" --hide-histogram --test-time 180
24+
arguments: --pipeline 10 -c 50 -t 4 --command="GEOHASH key 1" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geohash.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: -c 2 -t 2 --command="GEOHASH key 1" --hide-histogram --test-time 180
24+
arguments: -c 50 -t 4 --command="GEOHASH key 1" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geopos-pipeline-10.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: --pipeline 10 -c 2 -t 2 --command="GEOPOS key 1" --hide-histogram --test-time 180
24+
arguments: --pipeline 10 -c 50 -t 4 --command="GEOPOS key 1" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geopos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: -c 2 -t 2 --command="GEOPOS key 1" --hide-histogram --test-time 180
24+
arguments: -c 50 -t 4 --command="GEOPOS key 1" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geosearch-fromlonlat-bybox.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: -c 2 -t 2 --command="GEOSEARCH key FROMLONLAT 7.0 55.0 BYBOX 200 200 KM" --hide-histogram --test-time 180
24+
arguments: -c 2 -t 4 --command="GEOSEARCH key FROMLONLAT 7.0 55.0 BYBOX 200 200 KM" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geosearch-fromlonlat-pipeline-10.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: --pipeline 10 -c 2 -t 2 --command="GEOSEARCH key FROMLONLAT 7.0 55.0 BYRADIUS 200 KM" --hide-histogram --test-time 180
24+
arguments: --pipeline 10 -c 2 -t 4 --command="GEOSEARCH key FROMLONLAT 7.0 55.0 BYRADIUS 200 KM" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'

redis_benchmarks_specification/test-suites/memtier_benchmark-1key-geo-60M-elements-geosearch-fromlonlat.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dbconfig:
99
dataset: https://s3.us-east-2.amazonaws.com/redis.benchmarks.spec/datasets/geopoint/dump.rdb
1010
resources:
1111
requests:
12-
memory: 1g
12+
memory: 6g
1313
tested-groups:
1414
- geo
1515
tested-commands:
@@ -21,7 +21,7 @@ build-variants:
2121
clientconfig:
2222
run_image: redislabs/memtier_benchmark:edge
2323
tool: memtier_benchmark
24-
arguments: -c 2 -t 2 --command="GEOSEARCH key FROMLONLAT 7.0 55.0 BYRADIUS 200 KM" --hide-histogram --test-time 180
24+
arguments: -c 2 -t 4 --command="GEOSEARCH key FROMLONLAT 7.0 55.0 BYRADIUS 200 KM" --hide-histogram --test-time 180
2525
resources:
2626
requests:
2727
cpus: '4'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 0.4
2+
name: memtier_benchmark-1key-zset-10-elements-zrange-all-elements-long-scores
3+
description: 'Runs memtier_benchmark, for a keyspace length of 1 SORTED SET key. The SORTED SET contains 10 elements in it and we query it using ZRANGE BYSCORE with a range of all elements. The scores are long numbers.'
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
check:
8+
keyspacelen: 1
9+
resources:
10+
requests:
11+
memory: 1g
12+
init_commands:
13+
- '"ZADD" "zset:10:long_score" "10000000" "lysbgqqfqw" "10000001" "mtccjerdon" "10000002" "jekkafodvk" "10000003" "nmgxcctxpn" "10000004" "vyqqkuszzh" "10000005" "pytrnqdhvs" "10000006" "oguwnmniig" "10000007" "gekntrykfh" "10000008" "nhfnbxqgol" "10000009" "cgoeihlnei"'
14+
tested-groups:
15+
- sorted-set
16+
tested-commands:
17+
- zrange
18+
redis-topologies:
19+
- oss-standalone
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
clientconfig:
23+
run_image: redislabs/memtier_benchmark:edge
24+
tool: memtier_benchmark
25+
arguments: --command="ZRANGE zset:10:long_score 0 1000000000 BYSCORE WITHSCORES" --hide-histogram --test-time 180
26+
resources:
27+
requests:
28+
cpus: '4'
29+
memory: 2g
30+
31+
priority: 53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 0.4
2+
name: memtier_benchmark-1key-zset-100-elements-zrangebyscore-all-elements-long-scores
3+
description: 'Runs memtier_benchmark, for a keyspace length of 1 SORTED SET key. The SORTED SET contains 100 elements in it and we query it using ZRANGEBYSCORE with a range of all elements. '
4+
dbconfig:
5+
configuration-parameters:
6+
save: '""'
7+
check:
8+
keyspacelen: 1
9+
resources:
10+
requests:
11+
memory: 1g
12+
init_commands:
13+
- '"ZADD" "zset:10:long_score" "10000000" "lysbgqqfqw" "10000001" "mtccjerdon" "10000002" "jekkafodvk" "10000003" "nmgxcctxpn" "10000004" "vyqqkuszzh" "10000005" "pytrnqdhvs" "10000006" "oguwnmniig" "10000007" "gekntrykfh" "10000008" "nhfnbxqgol" "10000009" "cgoeihlnei"'
14+
tested-groups:
15+
- sorted-set
16+
tested-commands:
17+
- zrangebyscore
18+
redis-topologies:
19+
- oss-standalone
20+
build-variants:
21+
- gcc:8.5.0-amd64-debian-buster-default
22+
clientconfig:
23+
run_image: redislabs/memtier_benchmark:edge
24+
tool: memtier_benchmark
25+
arguments: --command="ZRANGEBYSCORE zset:100:long_score 0 1 WITHSCORES" --hide-histogram --test-time 180
26+
resources:
27+
requests:
28+
cpus: '4'
29+
memory: 2g
30+
31+
priority: 7

0 commit comments

Comments
 (0)