Page request roundtrip time increases substantially after a bit of use

chris mckenzie kristopolous at yahoo.com
Mon Jan 24 20:14:04 EST 2011


Hi Eric,

I'll prepare a more formal response in a bit, but here is my test run:

My rackup file for this is:
use Rack::ShowExceptions
use Rack::ShowStatus
map "/static/" do
  run Rack::File.new(File.dirname(__FILE__))
end




My config file is:
pid "/tmp/my-pid.pid"

timeout 300
listen "*:7788", :backlog => 2048

stderr_path "/tmp/my-log.stderr.log"
stdout_path "/tmp/my-log.stdout.log"

worker_processes 10
Rainbows! do
  use :ThreadSpawn
  worker_connections 400
end


I have a static file, test.txt with the contents "Hello world"

After doing
rainbows -c config.rb rackup.ru

I then executed the shell script below:
#!/bin/tcsh
rm testrun
loop:
echo -n `/bin/date +%s.%N`," "  >> testrun
curl -s -w "%{time_connect}, %{time_pretransfer}, %{time_starttransfer}, 
%{time_total}\n" $1 -o /dev/null >> testrun
goto loop

On the localhost, for some time.

The memory footprint remained flat.
The CPU usage did not spike noticeably
netstat -an did reveal some CLOSE_WAIT values on the ports but nothing that 
hadn't previously been pointed out.

The (CSV) output of the test can be seen here:
http://qaa.ath.cx/single-request.csv.gz

For those of you without any visualization software, I made a rudimentary graph 
from the data here:

http://qaa.ath.cx/single-request.png

You can clearly see how the delay increases and then doesn't ever go back down 
to previous levels.


No web browser was running while this test was done and a grep -v on the stderr 
revealed that no other request other then for the localhost was satisfied.



I'll research answers to your previous questions now.  Thanks for looking into 
this!

~chris.
----- Original Message ----
From: Eric Wong <normalperson at yhbt.net>
To: Rainbows! list <rainbows-talk at rubyforge.org>
Sent: Mon, January 24, 2011 4:11:07 PM
Subject: Re: Page request roundtrip time increases substantially after a bit of 
use

Eric Wong <normalperson at yhbt.net> wrote:
> chris mckenzie <kristopolous at yahoo.com> wrote:
> > On the machine running rainbows if I do a netstat, I get this:
> > 
> > tcp        1      0 10.10.192.12:7788       10.10.131.165:17443     
>CLOSE_WAIT
> > tcp        1      0  10.10.192.12:7788       10.10.131.165:17352     
>CLOSE_WAIT
> > tcp        1    196 10.10.192.12:7788       10.10.131.165:17317     
>CLOSE_WAIT
> > tcp        1    196 10.10.192.12:7788       10.10.131.165:17310     
>CLOSE_WAIT
> 
>              ^ Strange that Send-Q is 1 across all those connections..
> 
> Did you see the machine/connection that ran curl in there?  How does
> hitting Rainbows! from localhost work?

One more thing, do you use Thread#{kill,exit,terminate}! or anything
that would prevent an ensure statement from firing and calling IO#close
on the client socket?

-- 
Eric Wong
_______________________________________________
Rainbows! mailing list - rainbows-talk at rubyforge.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying



      


More information about the rainbows-talk mailing list