Browse Source

Set improved ThreadPool values for nancy

Kevin Pullin 12 years ago
parent
commit
6d43f6dbbe
1 changed files with 4 additions and 1 deletions
  1. 4 1
      nancy/src/Global.asax.cs

+ 4 - 1
nancy/src/Global.asax.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Web;
 using System.Web;
 using Nancy;
 using Nancy;
 using Nancy.ErrorHandling;
 using Nancy.ErrorHandling;
+using System.Threading;
 
 
 namespace NancyBenchmark
 namespace NancyBenchmark
 {
 {
@@ -10,7 +11,9 @@ namespace NancyBenchmark
     {
     {
         protected void Application_Start()
         protected void Application_Start()
         {
         {
-            
+            var threads = 40 * Environment.ProcessorCount;
+            ThreadPool.SetMaxThreads(threads, threads);
+            ThreadPool.SetMinThreads(threads, threads);
         }
         }
     }
     }
 }
 }