From 64b33ee522375a8dc15be2875dfb7db4502259b0 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Sat, 18 Jun 2011 21:24:41 +0200 Subject: Imported Upstream version 1.8.2 --- db/cmdline.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'db/cmdline.cpp') diff --git a/db/cmdline.cpp b/db/cmdline.cpp index 900a782..2a10fb5 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(&cmdLine.port), "specify port number") ("bind_ip", po::value(&cmdLine.bind_ip), "comma separated list of ip addresses to listen on - all local ips by default") + ("maxConns",po::value(), "max number of simultaneous connections") ("logpath", po::value() , "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(), "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(); + 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 -- cgit v1.2.3