about summary refs log tree commit homepage
path: root/lib/rainbows/xepoll_thread_spawn
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-03 01:05:11 +0000
committerEric Wong <normalperson@yhbt.net>2011-05-03 01:05:11 +0000
commita7f5f17ba2047ef7143465f612007ea81871a79e (patch)
treefa93430a846c83dd1c79c41f193e4dd73a08f516 /lib/rainbows/xepoll_thread_spawn
parent01381ab4dfeb032c85e72724df889c7aa381aa32 (diff)
downloadrainbows-a7f5f17ba2047ef7143465f612007ea81871a79e.tar.gz
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.
Diffstat (limited to 'lib/rainbows/xepoll_thread_spawn')
-rw-r--r--lib/rainbows/xepoll_thread_spawn/client.rb5
1 files changed, 3 insertions, 2 deletions
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