about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/mongrel.rb2
-rw-r--r--lib/mongrel/tcphack.rb12
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index fa43942..067e136 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -6,6 +6,8 @@ require 'mongrel/cgi'
 require 'mongrel/handlers'
 require 'mongrel/command'
 require 'timeout'
+require 'mongrel/tcphack'
+
 
 # Mongrel module containing all of the classes (include C extensions) for running
 # a Mongrel web server.  It contains a minimalist HTTP server with just enough
diff --git a/lib/mongrel/tcphack.rb b/lib/mongrel/tcphack.rb
new file mode 100644
index 0000000..3f769b2
--- /dev/null
+++ b/lib/mongrel/tcphack.rb
@@ -0,0 +1,12 @@
+
+# A modification proposed by Sean Treadway that increases the default accept
+# queue of TCPServer to 1024 so that it handles more concurrent requests.
+class TCPServer
+   def initialize_with_backlog(*args)
+     initialize_without_backlog(*args)
+     listen(1024)
+   end
+
+   alias_method :initialize_without_backlog, :initialize
+   alias_method :initialize, :initialize_with_backlog
+end