Skip to content

Instantly share code, notes, and snippets.

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

Stress-test EC2

Ferramenta: ab - Apache HTTP server benchmarking tool

  • Application server: m3.2xlarge (São Paulo)
  • DataBase server: db.m3.xlarge (São Paulo)
  • ElasticSearch server: m3.2xlarge (São Paulo - mesma máquina da aplicação)

Requests

# Autencicando
$ curl -k -i -H "Content-Type: application/json" -X POST -d '{"email": "[email protected]", "password": "*****", "register": "APA91bFd2JaapE", "platform": "apachebench", "user_locale": "pt-BR"}' https://no.api.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.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.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:   273.031 seconds
  Requests per second:    29.30 [#/sec] (mean)
  Time per request:       3412.884 [ms] (mean)
  Time per request:       34.129 [ms] (mean, across all concurrent requests)
  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        0  834 1732.4    131   39753
  Processing:    42 2566 2500.7   1888   97597
  Waiting:       42 2530 2045.0   1885   27271
  Total:        514 3400 2735.5   2333   97597
  -----------2x
  Time taken for tests:   155.174 seconds
  Requests per second:    51.56 [#/sec] (mean)
  Time per request:       1939.675 [ms] (mean)
  Time per request:       19.397 [ms] (mean, across all concurrent requests)
  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        0  538 1376.2    103   18373
  Processing:    51 1370 2111.3    925   86764
  Waiting:       27 1326 1314.8    921    7391
  Total:        542 1908 2388.3   1082   86764

2. Agenda

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

  Time taken for tests:   374.135 seconds
  Requests per second:    34.75 [#/sec] (mean)
  Time per request:       2877.964 [ms] (mean)
  Time per request:       28.780 [ms] (mean, across all concurrent requests)
  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        0  850 1811.9    172   59044
  Processing:    50 2018 1899.3   1215   52767
  Waiting:       35 2001 1845.9   1203   14994
  Total:        442 2868 2309.0   2045   59960

Full Report

$ 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.dentaloffice.com.br/clinics/5/schedules
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking no.api.dentaloffice.com.br (be patient)
Completed 1300 requests
Completed 2600 requests
Completed 3900 requests
Completed 5200 requests
Completed 6500 requests
Completed 7800 requests
Completed 9100 requests
SSL read failed (5) - closing connection
Completed 10400 requests
Completed 11700 requests
Completed 13000 requests
Finished 13000 requests


Server Software:        nginx/1.4.6
Server Hostname:        no.api.dentaloffice.com.br
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

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

Concurrency Level:      100
Time taken for tests:   374.135 seconds
Complete requests:      13000
Failed requests:        2
   (Connect: 1, Receive: 0, Length: 1, Exceptions: 0)
Non-2xx responses:      12999
Total transferred:      12648027 bytes
HTML transferred:       1299900 bytes
Requests per second:    34.75 [#/sec] (mean)
Time per request:       2877.964 [ms] (mean)
Time per request:       28.780 [ms] (mean, across all concurrent requests)
Transfer rate:          33.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  850 1811.9    172   59044
Processing:    50 2018 1899.3   1215   52767
Waiting:       35 2001 1845.9   1203   14994
Total:        442 2868 2309.0   2045   59960

Percentage of the requests served within a certain time (ms)
  50%   2045
  66%   2901
  75%   4809
  80%   5204
  90%   5848
  95%   6187
  98%   6899
  99%   8365
 100%  59960 (longest request)
~/desenv/rhsotf/webapp ruby-2.3.1@rhweb armstrong [!?]

--------------------------------------------------------------------------------------------

~/desenv/rhsotf/api ruby-2.3.1@dentaloffice develop [!?]
$ 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.dentaloffice.com.br/procedures/?dental_insurance_id=8
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking no.api.dentaloffice.com.br (be patient)
Completed 800 requests
Completed 1600 requests
Completed 2400 requests
SSL handshake failed (5).
Completed 3200 requests
SSL handshake failed (5).
Completed 4000 requests
Completed 4800 requests
Completed 5600 requests
Completed 6400 requests
Completed 7200 requests
Completed 8000 requests
Finished 8000 requests


Server Software:        nginx/1.4.6
Server Hostname:        no.api.dentaloffice.com.br
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

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

Concurrency Level:      100
Time taken for tests:   273.031 seconds
Complete requests:      8000
Failed requests:        2
   (Connect: 0, Receive: 0, Length: 2, Exceptions: 0)
Non-2xx responses:      7998
Total transferred:      7782054 bytes
HTML transferred:       799800 bytes
Requests per second:    29.30 [#/sec] (mean)
Time per request:       3412.884 [ms] (mean)
Time per request:       34.129 [ms] (mean, across all concurrent requests)
Transfer rate:          27.83 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  834 1732.4    131   39753
Processing:    42 2566 2500.7   1888   97597
Waiting:       42 2530 2045.0   1885   27271
Total:        514 3400 2735.5   2333   97597

Percentage of the requests served within a certain time (ms)
  50%   2333
  66%   3692
  75%   5345
  80%   5585
  90%   6046
  95%   6323
  98%   7577
  99%   8656
 100%  97597 (longest 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.dentaloffice.com.br/procedures/?dental_insurance_id=8
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking no.api.dentaloffice.com.br (be patient)
Completed 800 requests
Completed 1600 requests
Completed 2400 requests
Completed 3200 requests
Completed 4000 requests
Completed 4800 requests
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
Completed 5600 requests
Completed 6400 requests
Completed 7200 requests
Completed 8000 requests
Finished 8000 requests


Server Software:        nginx/1.4.6
Server Hostname:        no.api.dentaloffice.com.br
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

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

Concurrency Level:      100
Time taken for tests:   155.174 seconds
Complete requests:      8000
Failed requests:        3
   (Connect: 0, Receive: 0, Length: 3, Exceptions: 0)
Non-2xx responses:      7997
Total transferred:      7781081 bytes
HTML transferred:       799700 bytes
Requests per second:    51.56 [#/sec] (mean)
Time per request:       1939.675 [ms] (mean)
Time per request:       19.397 [ms] (mean, across all concurrent requests)
Transfer rate:          48.97 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  538 1376.2    103   18373
Processing:    51 1370 2111.3    925   86764
Waiting:       27 1326 1314.8    921    7391
Total:        542 1908 2388.3   1082   86764

Percentage of the requests served within a certain time (ms)
  50%   1082
  66%   1232
  75%   1667
  80%   2564
  90%   4892
  95%   5324
  98%   5833
  99%   6279
 100%  86764 (longest request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment