From: Tanaka Akira Date: 2006-07-18T13:07:34+09:00 Subject: Re: net/http performance In article <17b6c68ca7a0c35209ac51f136506734@ruby-forum.com>, Luke Burton writes: > I tested this earlier ... but my version of Ruby doesn't have > read_nonblock, unfortunately. I haven't had a chance to pull down 1.8.5 > and re-test. This should work with 1.8.2. def rbuf_fill if IO.select([@io], nil, nil, @read_timeout) @rbuf << @io.sysread(16384) else raise Timeout::TimeoutError end end The enlarging buffer size should work well until in-kernel TCP buffer is large enough to store data receiving between successive rbuf_fill. If the in-kernel buffer is not large enough, the overhead should be reduced. I think timeout() is the first candidate to remove. -- Tanaka Akira