From bf4ea4f10c0f0f8596effd521e8dc04c4ed15e13 Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Thu, 16 Dec 2021 11:54:42 +0200 Subject: [PATCH] [scripts] Update dummy server benchmarking. --- scripts/benchmark.z-run | 20 +++++------------- scripts/execute.z-run | 13 ++++++++++++ scripts/go.z-run | 46 +++++++++++++++++++++++++++++++++++++++++ scripts/z-run | 1 + 4 files changed, 65 insertions(+), 15 deletions(-) diff --git a/scripts/benchmark.z-run b/scripts/benchmark.z-run index de44b6a..39851e2 100644 --- a/scripts/benchmark.z-run +++ b/scripts/benchmark.z-run @@ -136,7 +136,7 @@ ./.bin/wrk \ --threads 1 \ --connections 1 \ - --conn-reqs 1024 \ + --conn-reqs 65536 \ --timeout 1s \ --duration 30s \ --progress \ @@ -163,7 +163,7 @@ ./.bin/wrk \ --threads 1 \ --connections 1 \ - --conn-reqs 1024 \ + --conn-reqs 65536 \ --timeout 1s \ --duration 30s \ --progress \ @@ -206,20 +206,9 @@ -<< benchmark / dummy +<< benchmark / server-dummy test "${#}" -eq 0 _outputs="$( exec -- readlink -e -- ./.outputs )" - mkdir -p -- "${_outputs}/binaries/release" - rm -f -- "${_outputs}/binaries/release/kawipiko-server-dummy" - "${ZRUN[@]}" ':: go / tool' \ - build \ - -mod readonly \ - -tags netgo \ - -ldflags 'all=-s -extld=gcc -extldflags=-static' \ - -gcflags 'all=-l=4' \ - -o "${_outputs}/binaries/release/kawipiko-server-dummy" \ - -- ./cmd/server-dummy.go \ - # exec -- \ sudo -u root -n -E -P -- \ taskset -c 0,1 \ @@ -230,7 +219,8 @@ sudo -u "${USER}" -n -E -P -- \ env -i -- \ ./.outputs/binaries/release/kawipiko-server-dummy \ - "${@}" \ + "${@}" \ + "127.9.185.194:8080" \ # !! diff --git a/scripts/execute.z-run b/scripts/execute.z-run index cb47afa..42cb4e9 100644 --- a/scripts/execute.z-run +++ b/scripts/execute.z-run @@ -39,3 +39,16 @@ exec -- env -i -- ./.outputs/binaries/release/kawipiko-wrapper "${@}" !! + + + +<< execute / server-dummy / debug + "${ZRUN[@]}" ':: go / build / server-dummy / debug' + exec -- env -i -- ./.outputs/binaries/debug/kawipiko-server-dummy "${@}" +!! + +<< execute / server-dummy / release + "${ZRUN[@]}" ':: go / build / server-dummy / release' + exec -- env -i -- ./.outputs/binaries/release/kawipiko-server-dummy "${@}" +!! + diff --git a/scripts/go.z-run b/scripts/go.z-run index ab4f6f8..7393eba 100644 --- a/scripts/go.z-run +++ b/scripts/go.z-run @@ -140,6 +140,52 @@ +<< go / build / server-dummy / debug + test "${#}" -eq 0 + _outputs="$( exec -- readlink -e -- ./.outputs )" + mkdir -p -- "${_outputs}/binaries/debug" + if test -e "${_outputs}/binaries/debug/kawipiko-server-dummy" ; then + rm -- "${_outputs}/binaries/debug/kawipiko-server-dummy" + fi + exec -- \ + nodaemon \ + nice -n 19 \ + "${ZRUN[@]}" ':: go / tool' \ + build \ + -mod readonly \ + -o "${_outputs}/binaries/debug/kawipiko-server-dummy" \ + -- ./cmd/server-dummy.go \ + # +!! + + +<< go / build / server-dummy / release + test "${#}" -eq 0 + _outputs="$( exec -- readlink -e -- ./.outputs )" + mkdir -p -- "${_outputs}/binaries/release" + if test -e "${_outputs}/binaries/release/kawipiko-server-dummy" ; then + rm -- "${_outputs}/binaries/release/kawipiko-server-dummy" + fi + exec -- \ + nodaemon \ + nice -n 19 -- \ + "${ZRUN[@]}" ':: go / tool' \ + build \ + -mod readonly \ + -tags netgo \ + -a \ + -gcflags 'all=-l=4' \ + -ldflags 'all=-s' \ + -buildmode exe \ + -trimpath \ + -o "${_outputs}/binaries/release/kawipiko-server-dummy" \ + -- ./cmd/server-dummy.go \ + # +!! + + + + << go / build / all / release test "${#}" -eq 0 _outputs="$( exec -- readlink -e -- ./.outputs )" diff --git a/scripts/z-run b/scripts/z-run index 443f7f2..cafb467 100644 --- a/scripts/z-run +++ b/scripts/z-run @@ -7,6 +7,7 @@ ::// benchmark / ... ::// go / ... ::// documentation / ... +::// * && _/go.z-run