Permalink
Browse files

added --minThreads support to xsp. Missed that it my last commit.

  • Loading branch information...
1 parent 55d49b6 commit 1cbe4d8f60fd3eb3052e829483a69e19b4b884d7 @bassam bassam committed Aug 23, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/Mono.WebServer.XSP/main.cs
@@ -109,6 +109,9 @@ static void ShowHelp ()
Console.WriteLine (" Default value: 0.0.0.0");
Console.WriteLine (" AppSettings key name: MonoServerAddress");
Console.WriteLine ();
+ Console.WriteLine (" --minThreads N: the minimum number of threads the thread pool creates on startup.");
+ Console.WriteLine (" Increase this value to handle a sudden inflow of connections.");
+ Console.WriteLine (" Default value: (runtime default)");
Console.WriteLine (" --backlog N: the listen backlog. Default value: 500");
Console.WriteLine (" --https: enable SSL for the server");
Console.WriteLine (" Default value: false.");
@@ -365,6 +368,20 @@ public int RealMain (string [] args, bool root, IApplicationHost ext_apphost, bo
CheckAndSetOptions (a, Options.AppConfigDir, ref options);
settings.AppConfigDir = args [++i];
break;
+ case "--minThreads":
+ string mtstr = args [++i];
+ int minThreads = 0;
+ try {
+ minThreads = Convert.ToInt32 (mtstr);
+ } catch (Exception) {
+ Console.WriteLine ("The value given for minThreads is not valid {0}", mtstr);
+ return 1;
+ }
+
+ if (minThreads > 0)
+ ThreadPool.SetMinThreads(minThreads, minThreads);
+
+ break;
case "--nonstop":
settings.NonStop = true;
break;

0 comments on commit 1cbe4d8

Please sign in to comment.