2010-11-30 66 views
5

根據MSDN this文檔中processModel,所述自動配置=真集按照以下屬性與此KB文章:ASP .NET中processModel配置

maxWorkerThreads,maxIoThreads,minFreeThreads,minLocalRequestFreeThreads,MAXCONNECTION

要驗證此設置,我在ASP .NET 3.5有在Page_Load事件下面的代碼示例Web應用程序:

 int w, c; 

     ThreadPool.GetMinThreads(out w, out c); 

     // Write the numbers of minimum threads 
     Response.Write("Min: " + string.Format("{0}, {1}", w, c)); 

     w=0; 
     c = 0; 

     ThreadPool.GetMaxThreads(out w, out c); 

     Response.Write(" Max: " + string.Format("{0}, {1}", w, c)); 

     Response.Write(" Maxconnections: " + ServicePointManager.DefaultConnectionLimit); 

     Configuration conf = ConfigurationManager.OpenMachineConfiguration(); 
     ConfigurationSectionGroup secGrp = conf.SectionGroups["system.web"]; 
     ConfigurationSection sec = secGrp.Sections["httpRuntime"]; 
     Response.Write(" httpruntime settings: " + sec.ElementInformation.Properties["minFreeThreads"].Value + ", " + 
                sec.ElementInformation.Properties["minLocalRequestFreeThreads"].Value); 

     Response.Flush(); 

我得到的弗洛當我AUTOCONFIG運行頁面翼輸出設置爲假,然後設置爲true:

AUTOCONFIG =假:最小:2,2最大:40,40個MAXCONNECTIONS:10個的httpRuntime設置:8,4

autoConfig = true:Min:2,2 Max:200,200 Maxconnections:24 httpruntime設置:8

autoConfig = false按預期工作,默認值可以在輸出中看到,但設置爲真有點驚訝:

  1. 它確實設置了maxWorkerThreads和maxIoThrea ds屬性正確,因此輸出200(雙核CPU上100x2)。
  2. 然而,似乎沒有設置minWorkerThreads屬性,該屬性作爲每KB應該是:minWorkerThreads = maxWorkerThreads/2
  3. 此外,根據MSDN文檔設置AUTOCONFIG =真時,設置minFreeThreads和minLocalRequestFreeThreads屬性KB中推薦的值,但似乎也不是這種情況。我得到8和4的默認值。

我有點困惑,關於這裏發生了什麼的任何想法?我是否有錯誤的樣品?

+0

我試圖提高我的web服務吞吐量(目前僅爲少數用戶獲得100%的CPU負載),並遇到完全相同的問題。 AutoConfig啓用時,我獲得20個MaxWorkerThreads。 – R4cOON 2011-01-17 13:05:47

回答

0

我的猜測是,你正在處理的同類以下邏輯:

WCF 4: Higher Default Throttling Settings for WCF Services

在WCF 4,我們修改這些設置的默認值,使人們不必改變在大多數情況下是默認的。以下是主要的改變:

·MaxConcurrentSessions:默認爲100 * ProcessorCount

·MaxConcurrentCalls:默認爲16 * ProcessorCount

·MaxConcurrentInstances:默認是總上述兩個的,它遵循與之前相同的模式。