Skip to content

Instantly share code, notes, and snippets.

@ganesshkumar
Created December 22, 2017 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganesshkumar/5cd6845eb788055339763cb86896b05e to your computer and use it in GitHub Desktop.
Save ganesshkumar/5cd6845eb788055339763cb86896b05e to your computer and use it in GitHub Desktop.
OpenFaaS python afterburn template loadtest

Running the watchdog locally

➜  python-afterburn git:(master) ✗ mode=afterburn fast_fork=1 port=8081 fprocess="python2 index.py" fwatchdog
2017/12/22 19:19:39 OperationalMode: AfterBurn
Forking - python2 [index.py]
2017/12/22 19:19:39 Started logging stderr from function.
2017/12/22 19:19:39 Writing lock file at: /var/folders/q2/b6ph5sg17yx855gl6hzp7ypm0000gn/T/.lock

Testing

➜  openfaas ab -n 1000 -c 20 -p test_data.txt http://localhost:8081/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:
Server Hostname:        localhost
Server Port:            8081

Document Path:          /
Document Length:        46 bytes

Concurrency Level:      20
Time taken for tests:   0.656 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      163000 bytes
Total body sent:        146000
HTML transferred:       46000 bytes
Requests per second:    1525.34 [#/sec] (mean)
Time per request:       13.112 [ms] (mean)
Time per request:       0.656 [ms] (mean, across all concurrent requests)
Transfer rate:          242.80 [Kbytes/sec] received
                        217.48 kb/s sent
                        460.28 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.0      0      24
Processing:     1   12   4.4     11      37
Waiting:        1   12   4.3     11      36
Total:          1   13   4.4     12      38
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%     12
  66%     12
  75%     13
  80%     13
  90%     14
  95%     21
  98%     30
  99%     35
 100%     38 (longest request)

Running the watchdog locally

➜  python3-afterburn git:(master) ✗ mode=afterburn fast_fork=1 port=8081 fprocess="python3 index.py" fwatchdog
2017/12/22 19:22:29 OperationalMode: AfterBurn
Forking - python3 [index.py]
2017/12/22 19:22:29 Started logging stderr from function.
2017/12/22 19:22:29 Writing lock file at: /var/folders/q2/b6ph5sg17yx855gl6hzp7ypm0000gn/T/.lock

Testing

➜  openfaas ab -n 1000 -c 20 -p test_data.txt http://localhost:8081/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:
Server Hostname:        localhost
Server Port:            8081

Document Path:          /
Document Length:        46 bytes

Concurrency Level:      20
Time taken for tests:   0.718 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      163000 bytes
Total body sent:        146000
HTML transferred:       46000 bytes
Requests per second:    1391.96 [#/sec] (mean)
Time per request:       14.368 [ms] (mean)
Time per request:       0.718 [ms] (mean, across all concurrent requests)
Transfer rate:          221.57 [Kbytes/sec] received
                        198.46 kb/s sent
                        420.03 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.3      0      13
Processing:     1   13   4.4     13      33
Waiting:        1   13   4.2     13      32
Total:          1   14   4.1     13      34

Percentage of the requests served within a certain time (ms)
  50%     13
  66%     14
  75%     15
  80%     15
  90%     17
  95%     23
  98%     32
  99%     32
 100%     34 (longest request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment