Skip to content

Instantly share code, notes, and snippets.

@shogo82148
Last active November 4, 2015 22:45
Show Gist options
  • Save shogo82148/695c773e5735e46a587a to your computer and use it in GitHub Desktop.
Save shogo82148/695c773e5735e46a587a to your computer and use it in GitHub Desktop.
test of race-free SIGTERM handling
$ perl -MStarlet\ 999
Starlet version 999 required--this is only version 0.27_01.
BEGIN failed--compilation aborted.

# それぞれのコマンドを別ウインドウで実行
$ start_server --port 5000 --pid app.pid -- plackup -s Starlet --max-workers 20 app.psgi > /dev/null 2>&1
$ while true; do kill -HUP `cat app.pid`; sleep 1; done
$ ab -c 20 -n 100000 -r http://localhost:5000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
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 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software:        Plack::Handler::Starlet
Server Hostname:        localhost
Server Port:            5000

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      20
Time taken for tests:   20.453 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      14500725 bytes
HTML transferred:       1100055 bytes
Requests per second:    4889.36 [#/sec] (mean)
Time per request:       4.091 [ms] (mean)
Time per request:       0.205 [ms] (mean, across all concurrent requests)
Transfer rate:          692.38 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.0      1       9
Processing:     0    3   3.0      3     121
Waiting:        0    3   2.9      3     121
Total:          0    4   3.0      4     121

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      5
  90%      6
  95%      6
  98%      8
  99%      9
 100%    121 (longest request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment