Skip to content

Commit f30129c

Browse files
committed
benchmark: Make poller threads configurable for SQL benchmarks.
Also, set the default to 10 for the benchmark runners, because that produces the best results. Signed-off-by: Ben Pfaff <blp@feldera.com>
1 parent dcb83db commit f30129c

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

benchmark/feldera-sql/run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ def main():
291291
parser.add_argument('--output', action=argparse.BooleanOptionalAction, help='whether to write query output back to Kafka (default: --no-output)')
292292
parser.add_argument('--merge', action=argparse.BooleanOptionalAction, help='whether to merge all the queries into one program (default: --no-merge)')
293293
parser.add_argument('--storage', action=argparse.BooleanOptionalAction, help='whether to enable storage (default: --no-storage)')
294+
parser.add_argument("--poller-threads", required=False, type=int, help="Override number of poller threads to use")
294295
parser.add_argument('--min-storage-bytes', type=int, help='If storage is enabled, the minimum number of bytes to write a batch to storage.')
295296
parser.add_argument('--query', action='append', help='queries to run (by default, all queries), specify one or more of: ' + ','.join(sort_queries(QUERY_SQL.keys())))
296297
parser.add_argument('--input-topic-suffix', help='suffix to apply to input topic names (by default, "")')
@@ -313,6 +314,9 @@ def main():
313314
queries = sort_queries(parse_queries(parser.parse_args().query))
314315
cores = int(parser.parse_args().cores)
315316
storage = parser.parse_args().storage
317+
poller_threads = parser.parse_args().poller_threads
318+
if poller_threads is not None:
319+
kafka_options["poller_threads"] = poller_threads
316320
min_storage_bytes = parser.parse_args().min_storage_bytes
317321
if min_storage_bytes is not None:
318322
min_storage_bytes = int(min_storage_bytes)

benchmark/run-nexmark.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ case $runner:$language in
505505
--api-url="$api_url" \
506506
-O bootstrap.servers="${kafka_from_feldera:-${kafka_broker}}" \
507507
--cores $cores \
508+
--poller-threads 10 \
508509
--input-topic-suffix="-$partitions-$events" \
509510
--csv results.csv \
510511
--query $(if test $query = all; then echo all; else echo q$query; fi)

scripts/bench.bash

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,21 @@ fi
4747
KAFKA_BROKER=localhost:9092
4848
rpk topic -X brokers=$KAFKA_BROKER delete bid auction person
4949
cargo run -p dbsp_nexmark --example generate --features with-kafka -- --max-events ${MAX_EVENTS} -O bootstrap.servers=$KAFKA_BROKER
50-
FELDERA_API=http://localhost:8080
51-
python3 benchmark/feldera-sql/run.py --api-url $FELDERA_API -O bootstrap.servers=$KAFKA_BROKER --csv crates/nexmark/${NEXMARK_SQL_CSV_FILE} --csv-metrics crates/nexmark/${NEXMARK_SQL_METRICS_CSV_FILE} --metrics-interval 1
5250

53-
rpk topic -X brokers=$KAFKA_BROKER delete bid auction person
54-
cargo run -p dbsp_nexmark --example generate --features with-kafka -- --max-events ${MAX_EVENTS} -O bootstrap.servers=$KAFKA_BROKER
5551
FELDERA_API=http://localhost:8080
56-
python3 benchmark/feldera-sql/run.py --storage --api-url $FELDERA_API -O bootstrap.servers=$KAFKA_BROKER --csv crates/nexmark/${NEXMARK_SQL_STORAGE_CSV_FILE} --csv-metrics crates/nexmark/${NEXMARK_SQL_STORAGE_METRICS_CSV_FILE} --metrics-interval 1
52+
nexmark_sql_benchmark() {
53+
local csv=$1 metrics=$2; shift; shift
54+
python3 benchmark/feldera-sql/run.py \
55+
--api-url $FELDERA_API \
56+
-O bootstrap.servers=$KAFKA_BROKER \
57+
--csv "crates/nexmark/$csv" \
58+
--csv-metrics "crates/nexmark/$metrics" \
59+
--metrics-interval 1 \
60+
--poller-threads 10 \
61+
"$@"
62+
}
63+
nexmark_sql_benchmark "${NEXMARK_SQL_CSV_FILE}" "${NEXMARK_SQL_METRICS_CSV_FILE}"
64+
nexmark_sql_benchmark "${NEXMARK_SQL_STORAGE_CSV_FILE}" "${NEXMARK_SQL_STORAGE_METRICS_CSV_FILE}" --storage
5765

5866
# Run galen benchmark
5967
cargo bench --bench galen -- --workers 10 --csv ${GALEN_CSV_FILE}

0 commit comments

Comments
 (0)