From 79428bc5e7302551deb3bcd04f71d9da3b7c7ad5 Mon Sep 17 00:00:00 2001 From: hrj Date: Mon, 12 Apr 2021 16:56:59 +0530 Subject: [PATCH] reduce number of users in locust stress test by reducing wait time, we can generate same load with fewer users --- tests/locustfile.py | 4 ++-- tests/run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/locustfile.py b/tests/locustfile.py index df55b4c..941c45e 100644 --- a/tests/locustfile.py +++ b/tests/locustfile.py @@ -19,7 +19,7 @@ def _(environment, **kw): environment.process_exit_code = 0 class QuickStartUser(SequentialTaskSet): - wait_time = between(0.1,1) + wait_time = between(0.1,0.2) @task def captcha(self): @@ -52,6 +52,6 @@ class QuickStartUser(SequentialTaskSet): class User(FastHttpUser): - wait_time = between(0.1,1) + wait_time = between(0.1,0.2) tasks = [QuickStartUser] host = "http://localhost:8888" diff --git a/tests/run.sh b/tests/run.sh index 34ed4fd..0d10e93 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -7,7 +7,7 @@ java -jar target/scala-2.13/LibreCaptcha.jar & JAVA_PID=$! sleep 4 -locust --headless -u 1000 -r 100 --run-time 4m --stop-timeout 30 -f tests/locustfile.py +locust --headless -u 300 -r 100 --run-time 4m --stop-timeout 30 -f tests/locustfile.py status=$? kill $JAVA_PID