Page request roundtrip time increases substantially after a bit of use

chris mckenzie kristopolous at
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

My config file is:
pid "/tmp/"

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

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

After doing
rainbows -c config.rb

I then executed the shell script below:
rm testrun
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:

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

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 

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

Eric Wong <normalperson at> wrote:
> chris mckenzie <kristopolous at> wrote:
> > On the machine running rainbows if I do a netstat, I get this:
> > 
> > tcp        1      0     
> > tcp        1      0     
> > tcp        1    196     
> > tcp        1    196     
>              ^ 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
Do not quote signatures (like this one) or top post when replying


More information about the rainbows-talk mailing list