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/xepoll_thread_spawn/client.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/rainbows/xepoll_thread_spawn') diff --git a/lib/rainbows/xepoll_thread_spawn/client.rb b/lib/rainbows/xepoll_thread_spawn/client.rb index 9bee1d1..4111f27 100644 --- a/lib/rainbows/xepoll_thread_spawn/client.rb +++ b/lib/rainbows/xepoll_thread_spawn/client.rb @@ -4,6 +4,7 @@ require "sleepy_penguin" require "raindrops" module Rainbows::XEpollThreadSpawn::Client + HBUFSIZ = Rainbows.client_header_buffer_size N = Raindrops.new(1) max = Rainbows.server.worker_connections ACCEPTORS = Rainbows::HttpServer::LISTENERS.map do |sock| @@ -88,7 +89,7 @@ module Rainbows::XEpollThreadSpawn::Client end def epoll_run(buf) - case kgio_tryread(0x1000, buf) + case kgio_tryread(HBUFSIZ, buf) when :wait_readable return kato_set when String @@ -108,7 +109,7 @@ module Rainbows::XEpollThreadSpawn::Client def pipeline_ready(hp) env = hp.parse and return env - case buf = kgio_tryread(0x1000) + case buf = kgio_tryread(HBUFSIZ) when :wait_readable kato_set return false -- cgit v1.2.3-24-ge0c7