You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2018/07/26 08:13:55 UTC

[incubator-openwhisk] branch master updated: Add pause in latency test to handle asynchrounous log collecting. (#3898)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 006561f  Add pause in latency test to handle asynchrounous log collecting. (#3898)
006561f is described below

commit 006561f9a3e8b71be62680fd517b873472f66748
Author: Christian Bickel <gi...@cbickel.de>
AuthorDate: Thu Jul 26 10:13:52 2018 +0200

    Add pause in latency test to handle asynchrounous log collecting. (#3898)
    
    This change might need to increase the thresholds of the latency test, because the containers will be paused and unpaused now, because the duration between the requests is higher than the pause-grace.
---
 .travis.yml                                                      | 2 +-
 tests/performance/README.md                                      | 4 +++-
 .../gatling_tests/src/gatling/scala/LatencySimulation.scala      | 9 ++++++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 859f29b..12551d8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -67,7 +67,7 @@ jobs:
         - TERM=dumb ./tests/performance/wrk_tests/latency.sh "https://172.17.0.1:10001" "$(cat ansible/files/auth.guest)" 2m
         - TERM=dumb ./tests/performance/wrk_tests/throughput.sh "https://172.17.0.1:10001" "$(cat ansible/files/auth.guest)" 4 2 2m
         - OPENWHISK_HOST="172.17.0.1" CONNECTIONS="100" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-ApiV1Simulation
-        - OPENWHISK_HOST="172.17.0.1" MEAN_RESPONSE_TIME="1000" API_KEY="$(cat ansible/files/auth.guest)" EXCLUDED_KINDS="python:default,java:default,swift:default" ./gradlew gatlingRun-LatencySimulation
+        - OPENWHISK_HOST="172.17.0.1" MEAN_RESPONSE_TIME="1000" API_KEY="$(cat ansible/files/auth.guest)" EXCLUDED_KINDS="python:default,java:default,swift:default" PAUSE_BETWEEN_INVOKES="100" ./gradlew gatlingRun-LatencySimulation
         - OPENWHISK_HOST="172.17.0.1" API_KEY="$(cat ansible/files/auth.guest)" CONNECTIONS="100" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-BlockingInvokeOneActionSimulation
         # The following configuration does not make much sense. But we do not have enough users. But it's good to verify, that the test is still working.
         - OPENWHISK_HOST="172.17.0.1" USERS="1" REQUESTS_PER_SEC="1" ./gradlew gatlingRun-ColdBlockingInvokeSimulation
diff --git a/tests/performance/README.md b/tests/performance/README.md
index 9ea838d..f09d91b 100644
--- a/tests/performance/README.md
+++ b/tests/performance/README.md
@@ -87,7 +87,8 @@ OPENWHISK_HOST="openwhisk.mydomain.com" CONNECTIONS="10" REQUESTS_PER_SEC="50" .
 This simulation creates actions of the following four kinds: `nodejs:default`, `swift:default`, `java:default` and
 `python:default`.
 Afterwards the action is invoked once. This is the cold-start and will not be part of the thresholds.
-Next, the action will be invoked 100 times blocking and one after each other. The last step is, that the action will be deleted.
+Next, the action will be invoked 100 times blocking and one after each other. Between each invoke is a pause of
+`PAUSE_BETWEEN_INVOKES` milliseconds. The last step is to delete the action.
 
 Once one language is finished, the next kind will be taken. They are not running in parallel. There are never more than
 1 activations in the system, as we only want to meassure latency of warm activations.
@@ -102,6 +103,7 @@ Available environment variables:
 ```
 OPENWHISK_HOST          (required)
 API_KEY                 (required, format: UUID:KEY)
+PAUSE_BETWEEN_INVOKES   (default: 0)
 MEAN_RESPONSE_TIME      (required)
 MAX_MEAN_RESPONSE_TIME  (default: MEAN_RESPONSE_TIME)
 EXCLUDED_KINDS          (default: "", format: "python:default,java:default,swift:default")
diff --git a/tests/performance/gatling_tests/src/gatling/scala/LatencySimulation.scala b/tests/performance/gatling_tests/src/gatling/scala/LatencySimulation.scala
index 9ec41f0..a685681 100644
--- a/tests/performance/gatling_tests/src/gatling/scala/LatencySimulation.scala
+++ b/tests/performance/gatling_tests/src/gatling/scala/LatencySimulation.scala
@@ -24,6 +24,8 @@ import io.gatling.core.session.Expression
 import io.gatling.core.util.Resource
 import org.apache.commons.io.FileUtils
 
+import scala.concurrent.duration._
+
 class LatencySimulation extends Simulation {
   // Specify parameters for the run
   val host = sys.env("OPENWHISK_HOST")
@@ -31,6 +33,8 @@ class LatencySimulation extends Simulation {
   // Specify authentication
   val Array(uuid, key) = sys.env("API_KEY").split(":")
 
+  val pauseBetweenInvokes: Int = sys.env.getOrElse("PAUSE_BETWEEN_INVOKES", "0").toInt
+
   // Specify thresholds
   val meanResponseTime: Int = sys.env("MEAN_RESPONSE_TIME").toInt
   val maximalMeanResponseTime: Int = sys.env.getOrElse("MAX_MEAN_RESPONSE_TIME", meanResponseTime.toString).toInt
@@ -75,7 +79,10 @@ class LatencySimulation extends Simulation {
           .create(code, "${action._1}", "${action._4}"))
         .exec(openWhisk("Cold ${action._1} invocation").authenticate(uuid, key).action("${action._3}").invoke())
         .repeat(100) {
-          exec(openWhisk("Warm ${action._1} invocation").authenticate(uuid, key).action("${action._3}").invoke())
+          // Add a pause of 100 milliseconds. Reason for this pause is, that collecting of logs runs asynchronously in
+          // invoker. If this is not finished before the next request arrives, a new cold-start has to be done.
+          pause(pauseBetweenInvokes.milliseconds)
+            .exec(openWhisk("Warm ${action._1} invocation").authenticate(uuid, key).action("${action._3}").invoke())
         }
         .exec(openWhisk("Delete ${action._1} action").authenticate(uuid, key).action("${action._3}").delete())
     }