From 33cf16e950d32db97ef03fa304eb2b73e9b3cc87 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 6 Feb 2009 03:09:48 -0800 Subject: Support multiple listeners per-process 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. --- test/unit/test_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.3-24-ge0c7