2 if test -z "$V" ||
test 0 -eq "$V"
7 skip_models WriterThreadSpawn WriterThreadPool Base
8 skip_models StreamResponseEpoll
10 t_plan
6 "keepalive_timeout CPU usage tests for $model"
12 t_begin
"setup and start" && {
13 rainbows_setup
$model 50 666
14 grep 'worker_connections 50' $unicorn_config
15 grep 'keepalive_timeout 666' $unicorn_config
16 rainbows
-E deployment
-D times.ru
-c $unicorn_config
20 t_begin
'read current times' && {
21 eval "$(curl -sSf http://$listen/)"
24 echo "utime=$utime stime=$stime"
27 t_begin
'keepalive connections' && {
28 listen
=$listen $RUBY -rsocket -e '
29 host, port = ENV["listen"].split(/:/)
31 socks = (1..49).map do |i|
32 s = TCPSocket.new(host, port)
33 # need to write something to get around deferred accepts
34 s.write "GET /#{i} HTTP/1.1\r\nHost: example.com\r\n\r\n"
41 for i
in $
(awk 'BEGIN { for(i=0;i<60;++i) print i }' </dev
/null
)
44 eval "$(curl -sSf http://$listen/)"
45 echo "utime[$i] $before_utime => $utime" \
46 "stime[$i] $before_stime => $stime"
51 t_begin
"times not unreasonable" && {
52 echo "utime: $before_utime => $utime" \
53 "stime: $before_stime => $stime"
56 t_begin
"killing succeeds" && {
60 t_begin
"check stderr" && {