From 4e9abd786a65aed89ee4ca2223bd548f672635c2 Mon Sep 17 00:00:00 2001 From: aansaarii <72558613+aansaarii@users.noreply.github.com> Date: Sat, 25 Mar 2023 23:04:05 +0100 Subject: [PATCH] refactor(data-caching): Load uses fixed interval by default. (#424) * fix bug in data-caching entrypoint * Add negative exponential * doc: missing doc --------- Co-authored-by: Cyan Lin Co-authored-by: Cyan Lin --- benchmarks/data-caching/client/docker-entrypoint.sh | 9 ++++++--- docs/benchmarks/data-caching.md | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/benchmarks/data-caching/client/docker-entrypoint.sh b/benchmarks/data-caching/client/docker-entrypoint.sh index 120744b45..ec2a1fceb 100755 --- a/benchmarks/data-caching/client/docker-entrypoint.sh +++ b/benchmarks/data-caching/client/docker-entrypoint.sh @@ -9,6 +9,7 @@ INTERVAL=1 GET_RATIO=0.8 CONNECTION=200 RPS=10000 +NEGATIVE_EXPONENTIAL=false while (( ${#@} )); do case ${1} in @@ -20,6 +21,7 @@ while (( ${#@} )); do --g=*) GET_RATIO=${1#*=} ;; --c=*) CONNECTION=${1#*=} ;; --r=*) RPS=${1#*=} ;; + --ne) NEGATIVE_EXPONENTIAL=true ;; *) ARGS+=(${1}) ;; esac @@ -28,8 +30,6 @@ done set -- ${ARGS[@]} -echo "mode: ${MODE}, scale: ${SCALE}, workers: ${WORKERS}, server_memory: ${SERVER_MEMORY}, interval: ${INTERVAL}, get_ratio: ${GET_RATIO}, connections: ${CONNECTION}, rps: ${RPS}" - if [ "$MODE" = 'S&W' ]; then echo "scale and warmup" /usr/src/memcached/memcached_client/loader \ @@ -51,10 +51,13 @@ elif [ "$MODE" = 'TH' ]; then -g ${GET_RATIO} -w ${WORKERS} -c ${CONNECTION} -T ${INTERVAL} elif [ "$MODE" = 'RPS' ]; then echo "RPS" + if [ "$NEGATIVE_EXPONENTIAL" = true ]; then + ADDITIONA_OPTION="-e" + fi /usr/src/memcached/memcached_client/loader \ -a /usr/src/memcached/twitter_dataset/twitter_dataset_${SCALE}x \ -s /usr/src/memcached/memcached_client/docker_servers/docker_servers.txt \ - -g ${GET_RATIO} -w ${WORKERS} -c ${CONNECTION} -T ${INTERVAL} -e -r ${RPS} + -g ${GET_RATIO} -w ${WORKERS} -c ${CONNECTION} -T ${INTERVAL} $ADDITIONA_OPTION -r ${RPS} elif [ "$MODE" = "bash" ]; then # bash exec /bin/bash diff --git a/docs/benchmarks/data-caching.md b/docs/benchmarks/data-caching.md index c18202c6b..3f32edd59 100644 --- a/docs/benchmarks/data-caching.md +++ b/docs/benchmarks/data-caching.md @@ -89,7 +89,7 @@ This command will run the benchmark with the maximum throughput; however, the Qo $ docker exec -it dc-client /bin/bash /entrypoint.sh --m="RPS" --S=28 --g=0.8 --c=200 --w=8 --T=1 --r=rps -where `rps` is 90% of the maximum number of requests per second achieved using the previous command. You should experiment with different values of `rps` to achieve the maximum throughput without violating the target QoS requirements. +where `rps` is 90% of the maximum number of requests per second achieved using the previous command. You should experiment with different values of `rps` to achieve the maximum throughput without violating the target QoS requirements. By default, the request interval is fixed. You can add `--ne` to make the interval follow negative exponential distribution. Note that the last two commands will continue forever if you do not stop or kill the command. For running the command for a given amount of time, you can use the timeout command. The following example will run the benchmark in the `RPS` mode for 20 seconds: