You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ty...@apache.org on 2017/09/21 18:12:49 UTC

[incubator-openwhisk-performance] branch master updated: Moving from 'loadtest' to 'wrk' for better loadtest performance (#1)

This is an automated email from the ASF dual-hosted git repository.

tysonnorris pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-performance.git


The following commit(s) were added to refs/heads/master by this push:
     new 085bd5f  Moving from 'loadtest' to 'wrk' for better loadtest performance (#1)
085bd5f is described below

commit 085bd5fa160f3d5e69699af718eb0454e2b846d2
Author: Markus Thömmes <ma...@me.com>
AuthorDate: Thu Sep 21 20:12:47 2017 +0200

    Moving from 'loadtest' to 'wrk' for better loadtest performance (#1)
    
    * Moving from 'loadtest' to 'wrk' for better loadtest performance
    
    Signed-off-by: Christian Bickel <cb...@de.ibm.com>
    
    * Make the throughput.sh executable on both Mac and Linux
    
    * Remove consul from the deployment.
    
    * Adopt new way of defining limits
    
    * Define right location of post.lua
    
    * Formatting changes for loadtest.sh
---
 .travis.yml         |  2 +-
 README.md           |  2 +-
 deploy.sh           |  4 +---
 tests/latency.sh    |  9 +++++++--
 tests/post.lua      |  1 +
 tests/throughput.sh | 21 ++++++++++++++++-----
 6 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 6f256d3..422fcc5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,4 +11,4 @@ install:
 
 script:
   - ./tests/latency.sh "http://172.17.0.1:10001" "$(cat openwhisk/ansible/files/auth.guest)"
-  - ./tests/throughput.sh "http://172.17.0.1:10001" "$(cat openwhisk/ansible/files/auth.guest)" 4
\ No newline at end of file
+  - ./tests/throughput.sh "http://172.17.0.1:10001" "$(cat openwhisk/ansible/files/auth.guest)" 4 2 2m
\ No newline at end of file
diff --git a/README.md b/README.md
index 5e35629..50bdb15 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ A few simple but efficient performance test suites for Apache OpenWhisk. Determi
 - Limits are set to 999999 each, for the test's load that means: No throttling at all.
 - The deployment uses a docker setup as proposed by the OpenWhisk development team: `overlay` driver and HTTP API enabled via a UNIX port.
 
-The load is driven by the beautiful [`loadtest`](https://www.npmjs.com/package/loadtest) module.
+The load is driven by either the beautiful [`loadtest`](https://www.npmjs.com/package/loadtest) module or the blazingly fast [`wrk`](https://github.com/wg/wrk).
 
 ### Travis' machine setup
 The [machine provided by Travis](https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments) has ~2 CPU cores (likely shared through virtualization) and 7.5GB memory.
diff --git a/deploy.sh b/deploy.sh
index 9ca82ce..cacf6b3 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -14,8 +14,7 @@ git clone --depth 1 https://github.com/openwhisk/openwhisk.git
 pip install --user ansible==2.3.0.0
 
 cd openwhisk/ansible
-LIMITS='{"limits":{"actions":{"invokes":{"perMinute":999999,"concurrent":999999,"concurrentInSystem":999999}},"triggers":{"fires":{"perMinute":999999}}}}'
-ANSIBLE_CMD="ansible-playbook -i environments/local -e docker_image_prefix=openwhisk -e docker_registry=docker.io/ -e $LIMITS"
+ANSIBLE_CMD="ansible-playbook -i environments/local -e docker_image_prefix=openwhisk -e docker_registry=docker.io/ -e limit_invocations_per_minute=999999 -e limit_invocations_concurrent=999999 -e limit_invocations_concurrent_system=999999"
 
 $ANSIBLE_CMD setup.yml
 $ANSIBLE_CMD prereq.yml
@@ -23,7 +22,6 @@ $ANSIBLE_CMD couchdb.yml
 $ANSIBLE_CMD initdb.yml
 $ANSIBLE_CMD wipe.yml
 
-$ANSIBLE_CMD consul.yml
 $ANSIBLE_CMD kafka.yml
 $ANSIBLE_CMD controller.yml
 $ANSIBLE_CMD invoker.yml
\ No newline at end of file
diff --git a/tests/latency.sh b/tests/latency.sh
index 41f40ea..cb1a213 100755
--- a/tests/latency.sh
+++ b/tests/latency.sh
@@ -13,5 +13,10 @@ action="noopLatency"
 "$currentDir/create.sh" "$host" "$credentials" "$action"
 
 # run latency tests
-encodedAuth=$(echo "$credentials" | base64 -w 0)
-docker run --rm markusthoemmes/loadtest loadtest -n "$samples" -k -m POST -H "Authorization: basic $encodedAuth" "$host/api/v1/namespaces/_/actions/$action?blocking=true"
\ No newline at end of file
+encodedAuth=$(echo "$credentials" | base64 | tr -d '\n')
+docker run --rm markusthoemmes/loadtest loadtest \
+  -n "$samples" \
+  -k \
+  -m POST \
+  -H "Authorization: basic $encodedAuth" \
+  "$host/api/v1/namespaces/_/actions/$action?blocking=true"
\ No newline at end of file
diff --git a/tests/post.lua b/tests/post.lua
new file mode 100644
index 0000000..e3e664c
--- /dev/null
+++ b/tests/post.lua
@@ -0,0 +1 @@
+wrk.method = "POST"
\ No newline at end of file
diff --git a/tests/throughput.sh b/tests/throughput.sh
index 743e8a7..f23097b 100755
--- a/tests/throughput.sh
+++ b/tests/throughput.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 set -e
-currentDir="$(dirname "$0")"
+currentDir="$(cd "$(dirname "$0")"; pwd)"
 
 # Host to use. Needs to include the protocol.
 host=$1
@@ -9,12 +9,23 @@ credentials=$2
 # concurrency level of the throughput test: How many requests should
 # open in parallel.
 concurrency=$3
-# How many samples to create by the test. Default: 10000
-samples=${4:-10000}
+# How many threads to utilize, directly correlates to the number
+# of CPU cores
+threads=${4:-4}
+# How long to run the test
+duration=${5:-30s}
 
 action="noopThroughput"
 "$currentDir/create.sh" "$host" "$credentials" "$action"
 
 # run throughput tests
-encodedAuth=$(echo "$credentials" | base64 -w 0)
-docker run --rm markusthoemmes/loadtest loadtest -n "$samples" -c "$concurrency" -k -m POST -H "Authorization: basic $encodedAuth" "$host/api/v1/namespaces/_/actions/$action?blocking=true"
\ No newline at end of file
+encodedAuth=$(echo "$credentials" | base64 | tr -d '\n')
+docker run --pid=host --userns=host --rm -v "$currentDir":/data williamyeh/wrk \
+  --threads "$threads" \
+  --connections "$concurrency" \
+  --duration "$duration" \
+  --header "Authorization: basic $encodedAuth" \
+  "$host/api/v1/namespaces/_/actions/$action?blocking=true" \
+  --latency \
+  --timeout 10s \
+  --script post.lua
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].