diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-04-07 20:07:59 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-04-07 20:07:59 +0000 |
commit | 56ae99118f5c35612fe4fc440480984ea1e7aa29 (patch) | |
tree | 18fda64e03754636566eae9d2023ec1c0035d7ce | |
parent | 419a3545fadc3993da302fe7a35a773ac0ae0cac (diff) |
make max_concurrent_connections configurable via Randall Leeds / COUCHDB-705
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@931663 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | etc/couchdb/default.ini.tpl.in | 1 | ||||
-rw-r--r-- | src/couchdb/couch_httpd.erl | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in index 8e9d63da..1a0e7656 100644 --- a/etc/couchdb/default.ini.tpl.in +++ b/etc/couchdb/default.ini.tpl.in @@ -17,6 +17,7 @@ batch_save_interval = 1000 ; milliseconds after which to save batches [httpd] port = 5984 bind_address = 127.0.0.1 +max_connections = 2048 authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler} default_handler = {couch_httpd_db, handle_request} diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index b25242fd..f9cb7f40 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -35,6 +35,7 @@ start_link() -> BindAddress = couch_config:get("httpd", "bind_address", any), Port = couch_config:get("httpd", "port", "5984"), + MaxConnections = couch_config:get("httpd", "max_connections", "2048"), VirtualHosts = couch_config:get("vhosts"), DefaultSpec = "{couch_httpd_db, handle_request}", @@ -73,7 +74,8 @@ start_link() -> {loop, Loop}, {name, ?MODULE}, {ip, BindAddress}, - {port, Port} + {port, Port}, + {max, MaxConnections} ]) of {ok, MochiPid} -> {ok, MochiPid}; {error, Reason} -> @@ -86,6 +88,8 @@ start_link() -> ?MODULE:stop(); ("httpd", "port") -> ?MODULE:stop(); + ("httpd", "max_connections") -> + ?MODULE:stop(); ("httpd", "default_handler") -> ?MODULE:stop(); ("httpd_global_handlers", _) -> |