From b0cccf93670104f8e7bb6e8213f0f51b0d397f57 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Sat, 10 Nov 2018 13:28:41 +0200 Subject: [PATCH] [scripts] Add support for benchmarking --- .x-run | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/.x-run b/.x-run index 70c4cc5..3065dc4 100644 --- a/.x-run +++ b/.x-run @@ -5,12 +5,14 @@ << go / execute / server / debug "${X_RUN[@]}" ':: go / build / server / debug' + export -- GOMAXPROCS=2 exec -- ./.outputs/binaries/debug/cdb-http-server "${@}" exit -- 1 !! << go / execute / server / release "${X_RUN[@]}" ':: go / build / server / release' + export -- GOMAXPROCS=2 exec -- ./.outputs/binaries/release/cdb-http-server "${@}" exit -- 1 !! @@ -376,3 +378,89 @@ exit -- 1 !! + + + +<< benchmark / server + "${X_RUN[@]}" ':: go / build / server / release' + exec -- \ + sudo -u root -n -E -P -- \ + taskset -c 1,2,3 \ + nice -n -19 -- \ + ionice -c 2 -n 0 -- \ + chrt -r 10 \ + softlimit -o 16384 \ + env -i \ + GOMAXPROCS=4 \ + ./.outputs/binaries/release/cdb-http-server \ + --archive ./examples/hello-world.cdb \ + --bind 127.9.185.194:8080 \ + --preload \ + "${@}" \ + # + exit -- 1 +!! + +<< benchmark / client / 2048 + exec -- \ + sudo -u root -n -E -P -- \ + taskset -c 1,2,3 \ + nice -n -19 -- \ + ionice -c 2 -n 0 -- \ + chrt -r 10 \ + softlimit -o 16384 \ + env -i \ + "$( type -P -- wrk )" \ + --threads 4 \ + --connections 2048 \ + --timeout 6s \ + --duration 30s \ + --latency \ + "${@}" \ + -- http://127.9.185.194:8080/ \ + # + exit -- 1 +!! + +<< benchmark / client / 512 + exec -- \ + sudo -u root -n -E -P -- \ + taskset -c 1,2,3 \ + nice -n -19 -- \ + ionice -c 2 -n 0 -- \ + chrt -r 10 \ + softlimit -o 16384 \ + env -i \ + "$( type -P -- wrk )" \ + --threads 4 \ + --connections 512 \ + --timeout 6s \ + --duration 30s \ + --latency \ + "${@}" \ + -- http://127.9.185.194:8080/ \ + # + exit -- 1 +!! + +<< benchmark / client / 16 + exec -- \ + sudo -u root -n -E -P -- \ + taskset -c 1,2,3 \ + nice -n -19 -- \ + ionice -c 2 -n 0 -- \ + chrt -r 10 \ + softlimit -o 16384 \ + env -i \ + "$( type -P -- wrk )" \ + --threads 4 \ + --connections 16 \ + --timeout 6s \ + --duration 30s \ + --latency \ + "${@}" \ + -- http://127.9.185.194:8080/ \ + # + exit -- 1 +!! +