about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-02-06 03:09:48 -0800
committerEric Wong <normalperson@yhbt.net>2009-02-09 19:50:53 -0800
commit33cf16e950d32db97ef03fa304eb2b73e9b3cc87 (patch)
treedd00151946956f866220dccfbae9e9ee79498e73 /test
parentbf82641c8f8efdb0516730febfbb0b2498e1224e (diff)
downloadunicorn-33cf16e950d32db97ef03fa304eb2b73e9b3cc87.tar.gz
Use select(2) to multiplex non-blocking accept(2) calls between
them.  Additionally, aggressively make a bet after accepting
clients where we'll try to do a non-blocking accept(2) against
the full set of descriptors.  This is based on the assumption
that if we just accepted connections, we're probably reasonably
busy.

This should lead to lower latency under high load; but some
wasted cycles when requests come in intermitently.  By this same
logic, we don't really care for the thundering herd problem,
either; since it is only noticeable with many (hundreds) of
processes when most of them are idle.
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_server.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb
index df57989..ae8f5b8 100644
--- a/test/unit/test_server.rb
+++ b/test/unit/test_server.rb
@@ -25,7 +25,7 @@ class WebServerTest < Test::Unit::TestCase
     @tester = TestHandler.new
     @app = Rack::URLMap.new('/test' => @tester)
     redirect_test_io do
-      @server = HttpServer.new(@app, :Host => "127.0.0.1", :Port => @port)
+      @server = HttpServer.new(@app, :listeners => [ "127.0.0.1:#{@port}" ] )
     end
     @server.start
   end