jonmorehouse / gatekeeper

a pluggable http routing runtime
12 stars 1 forks source link

Optimize Modifier Plugin #72

Closed jonmorehouse closed 8 years ago

jonmorehouse commented 8 years ago
Lifting the server siege...
Transactions:                  32063 hits
Availability:                  99.92 %
Elapsed time:                  59.78 secs
Data transferred:              18.71 MB
Response time:                  0.01 secs
Transaction rate:             536.35 trans/sec
Throughput:                     0.31 MB/sec
Concurrency:                    6.26
Successful transactions:       32063
Failed transactions:              25
Longest transaction:            0.97

A local run, running 100 instances of the ModifierPlugin and I noticed that there wasn't any difference in that and a single modifier plugin, which makes me feel as if that's not a huge problem.

Interesting too note is that of the 32k requests here, 1400 of them took over a millisecond to go through which isn't totally awful.

One thing of interest here would be to set a retry / timeout on the plugins to see if they hang?

jonmorehouse commented 8 years ago
~programs/gatekeeper (optimizations*)$ ab -n 10000 -c 25 http://localhost:8000/httpbin
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
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 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests

Server Software:
Server Hostname:        localhost
Server Port:            8000

Document Path:          /httpbin
Document Length:        9 bytes

Concurrency Level:      25
Time taken for tests:   2.222 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      1460000 bytes
HTML transferred:       90000 bytes
Requests per second:    4499.69 [#/sec] (mean)
Time per request:       5.556 [ms] (mean)
Time per request:       0.222 [ms] (mean, across all concurrent requests)
Transfer rate:          641.56 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   2.5      1     135
Processing:     1    4   6.3      3     138
Waiting:        1    4   5.8      3     138
Total:          2    5   6.7      5     141

Percentage of the requests served within a certain time (ms)
  50%      5
  66%      5
  75%      5
  80%      6
  90%      6
  95%      7
  98%     10
  99%     13
 100%    141 (longest request)

So it appears that ab is much better; this has brought about a few issues where it seems like we have large performance degradations. For instance, some calls of this were as low as 900 req/second

jonmorehouse commented 8 years ago

So it appears that something somewhere is causing some issues after N requests.

What's interesting is that the first time I run ab on a new gatekeeper instance it appears to be fine! (fine, defined as around 4-4.5k requests per second.