Browse Source

Better tuned ThreadPool settings

Kevin Pullin 12 years ago
parent
commit
0605c845e5
1 changed files with 5 additions and 0 deletions
  1. 5 0
      servicestack/src/Global.asax.cs

+ 5 - 0
servicestack/src/Global.asax.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Threading;
 using System.Web;
 
 namespace ServiceStackBenchmark
@@ -7,6 +8,10 @@ namespace ServiceStackBenchmark
     {
         protected void Application_Start(object sender, EventArgs e)
         {
+            var threads = 40 * Environment.ProcessorCount;
+            ThreadPool.SetMaxThreads(threads, threads);
+            ThreadPool.SetMinThreads(threads, threads);
+
             new AppHost().Init();
         }