-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve the use of the data-caching client container * Update the data-caching doc * Update the data-caching doc * Update data-caching doc
- Loading branch information
Showing
3 changed files
with
84 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ RUN chmod +x /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
USER memcache | ||
CMD ["-rps", "18000"] | ||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,61 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
if [ "$1" = '-rps' ]; then | ||
# default configuration | ||
echo "dc-server, 11211" > "/usr/src/memcached/memcached_client/servers.txt" | ||
/usr/src/memcached/memcached_client/loader \ | ||
-a /usr/src/memcached/twitter_dataset/twitter_dataset_unscaled \ | ||
-o /usr/src/memcached/twitter_dataset/twitter_dataset_5x \ | ||
-s /usr/src/memcached/memcached_client/servers.txt \ | ||
-w 4 -S 5 -D 2048 -j | ||
ARGS=() | ||
MODE="bash" | ||
SCALE=30 | ||
WORKERS=4 | ||
SERVER_MEMORY=4096 | ||
INTERVAL=1 | ||
GET_RATIO=0.8 | ||
CONNECTION=200 | ||
RPS=10000 | ||
|
||
/usr/src/memcached/memcached_client//loader \ | ||
-a /usr/src/memcached/twitter_dataset/twitter_dataset_5x \ | ||
-s /usr/src/memcached/memcached_client/servers.txt \ | ||
-g 0.8 -c 200 -w 4 -e -r "$2" -t 123 -T 120 | ||
while (( ${#@} )); do | ||
case ${1} in | ||
--m=*) MODE=${1#*=} ;; | ||
--S=*) SCALE=${1#*=} ;; | ||
--w=*) WORKERS=${1#*=} ;; | ||
--D=*) SERVER_MEMORY=${1#*=} ;; | ||
--T=*) INTERVAL=${1#*=} ;; | ||
--g=*) GET_RATIO=${1#*=} ;; | ||
--c=*) CONNECTION=${1#*=} ;; | ||
--r=*) RPS=${1#*=} ;; | ||
*) ARGS+=(${1}) ;; | ||
esac | ||
|
||
else | ||
# custom command | ||
exec "$@" | ||
shift | ||
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 \ | ||
-a /usr/src/memcached/twitter_dataset/twitter_dataset_unscaled \ | ||
-o /usr/src/memcached/twitter_dataset/twitter_dataset_${SCALE}x \ | ||
-s /usr/src/memcached/memcached_client/docker_servers/docker_servers.txt \ | ||
-w ${WORKERS} -S ${SCALE} -D ${SERVER_MEMORY} -j -T ${INTERVAL} | ||
elif [ "$MODE" = 'W' ]; then | ||
echo "warmup" | ||
/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 \ | ||
-w ${WORKERS} -S 1 -D ${SERVER_MEMORY} -j -T ${INTERVAL} | ||
elif [ "$MODE" = 'TH' ]; then | ||
echo "max throughput" | ||
/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} | ||
elif [ "$MODE" = 'RPS' ]; then | ||
echo "RPS" | ||
/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} | ||
elif [ "$MODE" = "bash" ]; then | ||
# bash | ||
exec /bin/bash | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters