-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loadtests scenarios and README.md to use it
- Loading branch information
Emmanuel Gonzalez
committed
Dec 19, 2016
1 parent
6eb371f
commit c68532b
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Load testing Abe | ||
|
||
In order to loadtest [Abe](https://github.com/AdFabConnect/abejs) we choose to use [Locust](http://locust.io/). | ||
Why? Because it's simple and it's doing the job! | ||
|
||
## Pre-req | ||
|
||
Locust requires Python 2.6+. Python 3.x support is [coming](https://twitter.com/locustio/status/801736746727784448) | ||
|
||
## Installation | ||
|
||
See [locust.io installation](http://docs.locust.io/en/latest/installation.html) | ||
|
||
# Start load testing Abe | ||
|
||
We wrote 2 locust files called [manager.py](./manager.py) and [create.py](./create.py) | ||
For both scenarios below you have to setup the number of users you want and the number of users spawned per second. | ||
Start with 10 users and 1 user spawned/second to test and click `Start swarming`. | ||
|
||
## Manager | ||
|
||
We start with Abe's manager loadtest. | ||
|
||
- Run `locust -f manager.py --host=http://your.abe.com` from root of your locust install. | ||
- Go to `http://localhost:8089` on your favorite browser. | ||
- You're all set \o/. | ||
|
||
## Create | ||
|
||
Then we continue with testing content creation time response. | ||
For this test you'll have to set a abe.json file with secure cookie to false | ||
|
||
```javascript | ||
{ | ||
"cookie": { | ||
"secure": false | ||
}, | ||
"security" : false, | ||
} | ||
``` | ||
|
||
- Run `locust -f create.py --host=http://your.abe.com` from root of your locust install. | ||
- Go to `http://localhost:8089` on your favorite browser. | ||
|
||
# Abe Benchmark | ||
|
||
Below you find a benchmark (to be completed) of response time to display a content in Abe. | ||
|
||
## Test characteristics | ||
|
||
- 1.000 contents in Abe | ||
- locust parameters : 10 users | 1 user spawned/second | ||
- Duration : 5 mins | ||
- Each user call 1 content in abe | ||
|
||
## Result | ||
|
||
| Abe Version | Average Response Time (s)| | ||
|:-------------:|:------------------------:| | ||
| 1.8.0 |17,564 | | ||
| 2.1.0 |6,036 | | ||
| 2.2.1 |6,047 | | ||
| 2.2.2 |3,082 | | ||
| 2.3.1 |2,215 | | ||
| 2.6.8 |0,622 | | ||
|
||
Between 1.8.0 and 2.6.8 the Abe content load time was divided by **27**! The refactoring was on his way. Never ceased then... | ||
|
||
To be continued... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import random, string | ||
from locust import HttpLocust, TaskSet | ||
|
||
def create(l): | ||
rand_str = lambda n: ''.join([random.choice(string.lowercase) for i in xrange(n)]) | ||
s = rand_str(10) | ||
l.client.post("/abe/create/" + s, { | ||
"selectTemplate": "index", | ||
"name": s | ||
}) | ||
|
||
class UserBehavior(TaskSet): | ||
tasks = {create:1} | ||
|
||
class WebsiteUser(HttpLocust): | ||
task_set = UserBehavior | ||
min_wait=5000 | ||
max_wait=9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from locust import HttpLocust, TaskSet | ||
|
||
def manager(l): | ||
l.client.get("/abe/editor") | ||
|
||
class UserBehavior(TaskSet): | ||
tasks = {manager:1} | ||
|
||
class WebsiteUser(HttpLocust): | ||
task_set = UserBehavior | ||
min_wait=5000 | ||
max_wait=9000 |