Skip to content

Instantly share code, notes, and snippets.

@altherlex
Last active March 18, 2017 00:49
Show Gist options
  • Save altherlex/fb9b0f48a33010d8fb74075af0e6ad93 to your computer and use it in GitHub Desktop.
Save altherlex/fb9b0f48a33010d8fb74075af0e6ad93 to your computer and use it in GitHub Desktop.
Stress test for Opsworks

Stress-test OpsWorks+LoadBalancer

~9 min - para ligar uma nova instância (teste c3.large)

Ferramenta: ab - Apache HTTP server benchmarking tool

  • Application server: t2.small (Virgínia)
  • DataBase server: db.t2.small (Virgínia)
  • ElasticSearch server: m3.medium (Virgínia)

Requests

# Autencicando
$ curl -i -H "Content-Type: application/json" -X POST -d '{"email": "[email protected]", "password": "*****", "register": "APA91bFd2JaapE", "platform": "apachebench", "user_locale": "pt-BR"}' https://no.api.opsworks.dentaloffice.com.br/auth/tokens

$ ab -n 8000 -c 100 -v -C    -H "HTTP_ACCEPT: application/json"   -H "X-User-Token: AexmfrCnhMCyMNz3wRrA"   -H "X-User-Email: [email protected]"   -H "X-Device-Register: APA91bFd2JaapE"   https://no.api.opsworks.dentaloffice.com.br/procedures/?dental_insurance_id=8

$ ab -n 13000 -c 100 -v -C -H "HTTP_ACCEPT: application/json" -H "X-User-Token: AexmfrCnhMCyMNz3wRrA" -H "X-User-Email: [email protected]" -H "X-Device-Register: APA91bFd2JaapE" https://no.api.opsworks.dentaloffice.com.br/clinics/5/schedules

1. Procedimentos

/procedures/?dental_insurance_id=8 - 8000 requisições de 100 em 100 simultâneas.

  Time taken for tests:   232.836 seconds
  Requests per second:    34.36 [#/sec] (mean)
  Time per request:       2910.455 [ms] (mean)
  Time per request:       29.105 [ms] (mean, across all concurrent requests)

  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        0 1785 2957.7    707   49033
  Processing:   132 1089 4936.3    214   66379
  Waiting:        0 1073 4922.9    206   66379
  Total:        613 2873 6107.6    953   80508
  ---------2x
  Time taken for tests:   318.948 seconds
  Requests per second:    25.08 [#/sec] (mean)
  Time per request:       3986.854 [ms] (mean)
  Time per request:       39.869 [ms] (mean, across all concurrent requests)

  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        0 2338 4377.3    764   59254
  Processing:   131 1458 5890.8    370   68787
  Waiting:      131 1419 5712.4    360   60752
  Total:        549 3797 7493.6   1397   71435

2. Agenda

/clinics/5/schedules - 13000 requisições de 100 em 100 simultâneas.

  Time taken for tests:   392.028 seconds
  Requests per second:    33.16 [#/sec] (mean)
  Time per request:       3015.599 [ms] (mean)
  Time per request:       30.156 [ms] (mean, across all concurrent requests)

  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:      411 1901 3419.4    720   58025
  Processing:   132 1055 4780.7    221   64811
  Waiting:      131 1048 4774.1    213   64811
  Total:        549 2956 5993.3   1010   73951

Full Report

  • Agenda requests
  • Procedimentos request (2x)

1. Agenda requests

$ ab -n 13000 -c 100 -v -C -H "HTTP_ACCEPT: application/json" -H "X-User-Token: AexmfrCnhMCyMNz3wRrA" -H "X-User-Email: [email protected]" -H "X-Device-Register: APA91bFd2JaapE" https://no.api.opsworks.dentaloffice.com.br/clinics/5/schedules

Server Software:        nginx/1.4.6
Server Hostname:        no.api.opsworks.dentaloffice.com.br
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /clinics/5/schedules
Document Length:        110 bytes

Concurrency Level:      100
Time taken for tests:   392.028 seconds
Complete requests:      13000
Failed requests:        12371
   (Connect: 0, Receive: 0, Length: 12371, Exceptions: 0)
Non-2xx responses:      13000
Total transferred:      1946172 bytes
HTML transferred:       69190 bytes
Requests per second:    33.16 [#/sec] (mean)
Time per request:       3015.599 [ms] (mean)
Time per request:       30.156 [ms] (mean, across all concurrent requests)
Transfer rate:          4.85 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      411 1901 3419.4    720   58025
Processing:   132 1055 4780.7    221   64811
Waiting:      131 1048 4774.1    213   64811
Total:        549 2956 5993.3   1010   73951

Percentage of the requests served within a certain time (ms)
  50%   1010
  66%   1766
  75%   3170
  80%   4534
  90%   6222
  95%   8156
  98%  16694
  99%  31243
 100%  73951 (longest request)

2. Procedimentos request (2x)

$ ab -n 8000 -c 100 -v -C    -H "HTTP_ACCEPT: application/json"   -H "X-User-Token: AexmfrCnhMCyMNz3wRrA"   -H "X-User-Email: [email protected]"   -H "X-Device-Register: APA91bFd2JaapE"   https://no.api.opsworks.dentaloffice.com.br/procedures/?dental_insurance_id=8

Server Software:        nginx/1.4.6
Server Hostname:        no.api.opsworks.dentaloffice.com.br
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /procedures/?dental_insurance_id=8
Document Length:        110 bytes

Concurrency Level:      100
Time taken for tests:   232.836 seconds
Complete requests:      8000
Failed requests:        7860
   (Connect: 0, Receive: 0, Length: 7860, Exceptions: 0)
Non-2xx responses:      7988
Total transferred:      959859 bytes
HTML transferred:       14080 bytes
Requests per second:    34.36 [#/sec] (mean)
Time per request:       2910.455 [ms] (mean)
Time per request:       29.105 [ms] (mean, across all concurrent requests)
Transfer rate:          4.03 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0 1785 2957.7    707   49033
Processing:   132 1089 4936.3    214   66379
Waiting:        0 1073 4922.9    206   66379
Total:        613 2873 6107.6    953   80508

Percentage of the requests served within a certain time (ms)
  50%    953
  66%   1448
  75%   2492
  80%   4341
  90%   6000
  95%   7471
  98%  18277
  99%  31778
 100%  80508 (longest request)
~/desenv/rhsotf ruby-2.2.1

-------------------------------------
$ ab -n 8000 -c 100 -v -C    -H "HTTP_ACCEPT: application/json"   -H "X-User-Token: AexmfrCnhMCyMNz3wRrA"   -H "X-User-Email: [email protected]"   -H "X-Device-Register: APA91bFd2JaapE"   https://no.api.opsworks.dentaloffice.com.br/procedures/?dental_insurance_id=8

Server Software:
Server Hostname:        no.api.opsworks.dentaloffice.com.br
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128

Document Path:          /procedures/?dental_insurance_id=8
Document Length:        0 bytes

Concurrency Level:      100
Time taken for tests:   318.948 seconds
Complete requests:      8000
Failed requests:        3784
   (Connect: 0, Receive: 0, Length: 3784, Exceptions: 0)
Non-2xx responses:      7996
Total transferred:      4281303 bytes
HTML transferred:       416240 bytes
Requests per second:    25.08 [#/sec] (mean)
Time per request:       3986.854 [ms] (mean)
Time per request:       39.869 [ms] (mean, across all concurrent requests)
Transfer rate:          13.11 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0 2338 4377.3    764   59254
Processing:   131 1458 5890.8    370   68787
Waiting:      131 1419 5712.4    360   60752
Total:        549 3797 7493.6   1397   71435

Percentage of the requests served within a certain time (ms)
  50%   1397
  66%   2241
  75%   3753
  80%   4798
  90%   7796
  95%  13454
  98%  25360
  99%  55126
 100%  71435 (longest request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment