From: Florian Frank Date: 2006-07-17T17:39:08+09:00 Subject: Re: Net::HTTP Performance.... Ola Bini wrote: > Yes, and yes. The fix is basically to go into your > $RUBY_HOME/lib/ruby/1.8/net/protocol.rb, find the method called > rbuf_fill and change the sysread to something bigger than 1024. > Probably 8192 or 16384 would be good enough for your purposes. Ruby being Ruby, you can also just reopen the class and redefine the method in question to your liking: class ::Net::BufferedIO def rbuf_fill timeout(@read_timeout) { @rbuf << @io.sysread(8192) } end end But it's probably not a good idea to release code like this in a library to the public.