From a7f5f17ba2047ef7143465f612007ea81871a79e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 3 May 2011 01:05:11 +0000 Subject: add client_header_buffer_size tuning parameter We're changing our default to 1K buffers to save memory. This should reduce memory usage of idle clients and lower pressure on the MRI GC. Rails applications using session cookies (the default) may want to up this to 2K or more. --- lib/rainbows/coolio/client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/coolio') diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb index 2de421a..5688730 100644 --- a/lib/rainbows/coolio/client.rb +++ b/lib/rainbows/coolio/client.rb @@ -45,7 +45,7 @@ class Rainbows::Coolio::Client < Coolio::IO end def on_readable - buf = @_io.kgio_tryread(16384, RBUF) + buf = @_io.kgio_tryread(HBUFSIZ, RBUF) case buf when :wait_readable when nil # eof @@ -134,7 +134,7 @@ class Rainbows::Coolio::Client < Coolio::IO close if @_write_buffer.empty? when :headers if @buf.empty? - buf = @_io.kgio_tryread(16384, RBUF) or return close + buf = @_io.kgio_tryread(HBUFSIZ, RBUF) or return close String === buf and return on_read(buf) # buf == :wait_readable unless enabled? -- cgit v1.2.3-24-ge0c7