summary refs log tree commit homepage
path: root/lib/rainbows/xepoll_thread_spawn.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/xepoll_thread_spawn.rb')
-rw-r--r--lib/rainbows/xepoll_thread_spawn.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/rainbows/xepoll_thread_spawn.rb b/lib/rainbows/xepoll_thread_spawn.rb
index ad2bdc4..d94cf48 100644
--- a/lib/rainbows/xepoll_thread_spawn.rb
+++ b/lib/rainbows/xepoll_thread_spawn.rb
@@ -3,7 +3,41 @@ require "thread"
 require "sleepy_penguin"
 require "raindrops"
 
+# This is an edge-triggered epoll concurrency model with blocking
+# accept() in a (hopefully) native thread.  This is comparable to
+# ThreadSpawn and CoolioThreadSpawn, but is Linux-only and able to exploit
+# "wake one" accept() behavior of a blocking accept() call when used
+# with native threads.
+#
+# This supports streaming "rack.input" and allows +:pool_size+ tuning
+# independently of +worker_connections+
+#
+# === Disadvantages
+#
+# This is only supported under Linux 2.6 kernels.
+#
+# === Compared to CoolioThreadSpawn
+#
+# This does not buffer outgoing responses in userspace at all, meaning
+# it can lower response latency to fast clients and also prevent
+# starvation of other clients when reading slow disks for responses
+# (when combined with native threads).
+#
+# CoolioThreadSpawn is likely better for trickling large static files or
+# proxying responses to slow clients, but this is likely better for fast
+# clients.
+#
+# Unlikely CoolioThreadSpawn, this supports streaming "rack.input" which
+# is useful for reading large uploads from fast clients.
+#
+# === Compared to ThreadSpawn
+#
+# This can maintain idle connections without the memory overhead of an
+# idle Thread.  The cost of handling/dispatching active connections is
+# exactly the same for an equivalent number of active connections.
+
 module Rainbows::XEpollThreadSpawn
+  # :stopdoc:
   include Rainbows::Base
 
   def init_worker_process(worker)
@@ -16,4 +50,5 @@ module Rainbows::XEpollThreadSpawn
     init_worker_process(worker)
     Client.loop
   end
+  # :startdoc:
 end