diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-06-06 11:16:57 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-06-06 11:17:19 -0400 |
commit | 2e817ce6ba0934d6eb0dcfc39fc7adc9f9ce0eea (patch) | |
tree | 66a55e4c0714630e5b538fbd1d60d214e9d52ab0 | |
parent | 7c220fa4b5c212667f87c1de3d07f1b1ec8d9051 (diff) | |
download | mongo-2e817ce6ba0934d6eb0dcfc39fc7adc9f9ce0eea.tar.gz |
maxconns for mongos
-rw-r--r-- | db/cmdline.cpp | 15 | ||||
-rw-r--r-- | db/db.cpp | 13 |
2 files changed, 15 insertions, 13 deletions
diff --git a/db/cmdline.cpp b/db/cmdline.cpp index 900a7829c94..2a10fb50fdc 100644 --- a/db/cmdline.cpp +++ b/db/cmdline.cpp @@ -20,6 +20,7 @@ #include "cmdline.h" #include "commands.h" #include "../util/processinfo.h" +#include "../util/message.h" #include "security_key.h" #ifdef _WIN32 @@ -50,6 +51,7 @@ namespace mongo { ("quiet", "quieter output") ("port", po::value<int>(&cmdLine.port), "specify port number") ("bind_ip", po::value<string>(&cmdLine.bind_ip), "comma separated list of ip addresses to listen on - all local ips by default") + ("maxConns",po::value<int>(), "max number of simultaneous connections") ("logpath", po::value<string>() , "log file to send write to instead of stdout - has to be a file, not directory" ) ("logappend" , "append to logpath instead of over-writing" ) ("pidfilepath", po::value<string>(), "full path to pidfile (if not set, no pidfile is created)") @@ -163,6 +165,19 @@ namespace mongo { cmdLine.quiet = true; } + if ( params.count( "maxConns" ) ) { + int newSize = params["maxConns"].as<int>(); + if ( newSize < 5 ) { + out() << "maxConns has to be at least 5" << endl; + dbexit( EXIT_BADOPTIONS ); + } + else if ( newSize >= 10000000 ) { + out() << "maxConns can't be greater than 10000000" << endl; + dbexit( EXIT_BADOPTIONS ); + } + connTicketHolder.resize( newSize ); + } + string logpath; #ifndef _WIN32 diff --git a/db/db.cpp b/db/db.cpp index 97869c52250..579b4a1acb9 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -639,7 +639,6 @@ int main(int argc, char* argv[]) { ("journalOptions", po::value<int>(), "journal diagnostic options") ("ipv6", "enable IPv6 support (disabled by default)") ("jsonp","allow JSONP access via http (has security implications)") - ("maxConns",po::value<int>(), "max number of simultaneous connections") ("noauth", "run without security") ("nohttpinterface", "disable http interface") ("noprealloc", "disable data file preallocation - will often hurt performance") @@ -996,18 +995,6 @@ int main(int argc, char* argv[]) { if ( params.count( "profile" ) ) { cmdLine.defaultProfile = params["profile"].as<int>(); } - if ( params.count( "maxConns" ) ) { - int newSize = params["maxConns"].as<int>(); - if ( newSize < 5 ) { - out() << "maxConns has to be at least 5" << endl; - dbexit( EXIT_BADOPTIONS ); - } - else if ( newSize >= 10000000 ) { - out() << "maxConns can't be greater than 10000000" << endl; - dbexit( EXIT_BADOPTIONS ); - } - connTicketHolder.resize( newSize ); - } if (params.count("nounixsocket")) { noUnixSocket = true; } |