Skip to content

Commit ec29c4a

Browse files
DCPerf mini: Shrinking Feedsim even further (#241)
Summary: The diff introduces two key optimizations to reduce execution time: ### 1. **Dynamic Result Polling** * Replaced fixed wait times with intelligent polling that checks for QPS results every 100ms * Makes feedsim 10x more responsive by detecting results immediately when available * Maintains the same maximum wait time but exits early when results are ready * Eliminates unnecessary waiting periods ### 2. **Configurable Queue Drain Time** * Added new `-D` command-line option to configure post-experiment queue drain time * Previously hardcoded at 5 seconds, now user-adjustable (e.g., `-D 10` for 10 seconds) * Allows optimization for different workload requirements and benchmark scenarios Differential Revision: D83279537
1 parent c1aa26e commit ec29c4a

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

benchpress/config/jobs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,17 +476,19 @@
476476
- '-x {max_warmup_iterations}'
477477
- '-S {graph_store_path}'
478478
- '-L {graph_load_path}'
479+
- '-D {queue_drain_time}'
479480
- '-N'
480481
- '{extra_args}'
481482
vars:
482483
- 'num_instances=-1'
483484
- 'fixed_qps=100000'
484-
- 'fixed_qps_duration=10'
485+
- 'fixed_qps_duration=5'
485486
- 'warmup_time=4'
486487
- 'qps_percentage_threshold=-1'
487488
- 'max_warmup_iterations=-1'
488489
- 'graph_store_path=default_do_not_store'
489490
- 'graph_load_path=default_do_not_load'
491+
- 'queue_drain_time=1'
490492
- 'extra_args='
491493
hooks:
492494
- hook: copymove

packages/feedsim/run.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Usage: ${0##*/} [OPTION]...
7272
QPS increase is less than this threshold percentage of the previous QPS.
7373
-x Maximum number of warmup iterations when using QPS threshold. Default: 10
7474
-N No retry mode. Skip sleep and PID checking in load test startup, break immediately without retrying.
75+
-D Drain time in seconds. Time to wait for queue to drain after experiments. Default: 5
7576
EOF
7677
}
7778

@@ -148,6 +149,9 @@ main() {
148149
local no_retry_mode
149150
no_retry_mode=""
150151

152+
local queue_drain_time
153+
queue_drain_time="5"
154+
151155
if [ -z "$IS_AUTOSCALE_RUN" ]; then
152156
echo > $BREPS_LFILE
153157
fi
@@ -214,6 +218,9 @@ main() {
214218
-N)
215219
no_retry_mode="1"
216220
;;
221+
-D)
222+
queue_drain_time="$2"
223+
;;
217224
-h|--help)
218225
show_help >&2
219226
exit 1
@@ -224,7 +231,7 @@ main() {
224231
esac
225232

226233
case $1 in
227-
-t|-c|-s|-d|-p|-q|-o|-w|-i|-l|-S|-L|-r|-x)
234+
-t|-c|-s|-d|-p|-q|-o|-w|-i|-l|-S|-L|-r|-x|-D)
228235
if [ -z "$2" ]; then
229236
echo "Invalid option: '$1' requires an argument" 1>&2
230237
exit 1
@@ -350,7 +357,7 @@ main() {
350357
benchreps_tell_state "after fixed_qps_exp"
351358
fi
352359

353-
sleep 5 # wait for queue to drain
360+
sleep "$queue_drain_time" # wait for queue to drain
354361
kill -SIGINT $LEAF_PID || true > /dev/null # SIGINT so exits cleanly
355362
}
356363

packages/feedsim/third_party/src/scripts/search_qps.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,20 @@ run_loadtest() {
148148
kill -SIGINT $LOADTEST_PID
149149

150150
# wait for results to show up and queries to drain
151-
sleep $wait_time
152-
benchreps_tell_state "after sleeping for wait_time=${wait_time} seconds"
151+
iteration=0
152+
while [ $iteration -lt $((wait_time * 10)) ]; do
153+
sleep 0.1
154+
iteration=$((iteration + 1))
155+
156+
# Check if QPS results are available in the output file
157+
if grep -q "#: [0-9]\+.\([0-9]\+\)\? QPS" $tmp_file; then
158+
actual_wait_time=$(echo "scale=1; ${iteration} * 0.1" | bc)
159+
benchreps_tell_state "Results available after ${actual_wait_time} seconds"
160+
break
161+
fi
162+
done
163+
actual_wait_time=$(echo "scale=1; ${iteration} * 0.1" | bc)
164+
benchreps_tell_state "after waiting for results (waited ${actual_wait_time} seconds, max wait_time=${wait_time})"
153165

154166
# check file for QPS
155167
if grep -q "#: [0-9]\+.\([0-9]\+\)\? QPS" $tmp_file; then

0 commit comments

Comments
 (0)