From 55a2e8271edb613dd3532904c08e84616c3406af Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 23 Sep 2009 17:54:38 +0200 Subject: [PATCH] Decrease default TCP backlog to 128 ...after seeing http://lionet.livejournal.com/42016.html --- doc/api.html | 6 +++--- doc/api.txt | 4 ++-- doc/node.1 | 4 ++-- src/net.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/api.html b/doc/api.html index 09e1ca775ae..f5d7152e625 100644 --- a/doc/api.html +++ b/doc/api.html @@ -1528,7 +1528,7 @@ Creates a new TCP server. the "connection" event.

-server.listen(port, host=null, backlog=1024) +server.listen(port, host=null, backlog=128)

@@ -1536,7 +1536,7 @@ Tells the server to listen for TCP connections to port and host

host is optional. If host is not specified the server will accept client connections on any network address.

-

The third argument, backlog, is also optional and defaults to 1024. The +

The third argument, backlog, is also optional and defaults to 128. The backlog argument defines the maximum length to which the queue of pending connections for the server may grow.

This function is synchronous.

@@ -1944,7 +1944,7 @@ init (Handle<Object> target) diff --git a/doc/api.txt b/doc/api.txt index 96659b67ed7..a7ea452eac4 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -985,13 +985,13 @@ The +connection_listener+ argument is automatically set as a listener for the +"connection"+ event. -+server.listen(port, host=null, backlog=1024)+ :: ++server.listen(port, host=null, backlog=128)+ :: Tells the server to listen for TCP connections to +port+ and +host+. + +host+ is optional. If +host+ is not specified the server will accept client connections on any network address. + -The third argument, +backlog+, is also optional and defaults to 1024. The +The third argument, +backlog+, is also optional and defaults to 128. The +backlog+ argument defines the maximum length to which the queue of pending connections for the server may grow. + diff --git a/doc/node.1 b/doc/node.1 index d553bb86303..915994d4919 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -1443,7 +1443,7 @@ argument is automatically set as a listener for the event\. .RE .PP -server\.listen(port, host=null, backlog=1024) +server\.listen(port, host=null, backlog=128) .RS 4 Tells the server to listen for TCP connections to port @@ -1456,7 +1456,7 @@ host is not specified the server will accept client connections on any network address\. .sp The third argument, -backlog, is also optional and defaults to 1024\. The +backlog, is also optional and defaults to 128\. The backlog argument defines the maximum length to which the queue of pending connections for the server may grow\. .sp diff --git a/src/net.cc b/src/net.cc index 7e67cbe1748..53670dd05d5 100644 --- a/src/net.cc +++ b/src/net.cc @@ -521,7 +521,7 @@ Handle Server::Listen(const Arguments& args) { #endif char host[DNS_MAXNAME+1] = "\0"; - int backlog = 1024; + int backlog = 128; if (args.Length() == 2) { if (args[1]->IsInt32()) {