我的WCF服務配置:WCF響應時間,節流
<system.net>
<connectionManagement>
<add address ="*" maxconnection="500"/>
</connectionManagement>
</system.net>
<bindings>
<basicHttpBinding>
<binding name="customBasicHttpBinding"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
transferMode="StreamedResponse">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<security mode="None"/>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="customWebBinding" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<security mode="None">
</security>
</binding>
</webHttpBinding>
</bindings>
<serviceBehaviors>
<behavior name="soapBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<dataContractSerializer maxItemsInObjectGraph="6553600"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceThrottling maxConcurrentCalls="100"
maxConcurrentInstances="100" maxConcurrentSessions="100" />
</behavior>
</serviceBehaviors>
<services>
<service behaviorConfiguration="soapBehavior" name="Service.Service">
<endpoint name="soap"
address=""
binding="basicHttpBinding" bindingConfiguration="customBasicHttpBinding"
contract="ServiceModel.IService"/>
<endpoint
address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
正如你可以看到我設置節流參數處理100個併發實例。
對於我我的界面上創建虛擬方法的測試目的,看起來像這樣
[OperationContract]
string Test(){
return "test response time";
}
當我試圖調用此方法,它使用100平行請求的ats一次響應時間是非常糟糕:
現在運行的100個並行請求...
ResponseTimes:0,45205P,10,047P,0,43304P,0,86609P,1,33913P,0,91409P,1,34713P,1,75718P,1 ,37414P,1,80718P,1,80618P,2,22622P,2,64426P,2,22822P,2,62626P,2,68127P,3,0453P,3,10731P,3,47 635P,3,51035P,3,91039P,3,94039P,3,9544P,4,36844P,4,34943P,4,78748P,4,37144P,4,82248P,4,79048P,5,25052P,4,81948P, 5,657657P,5,25253P,5,71657P,5,67357P,6,13761P,5,70257P,6,56566P,6,12361P,7,0117P,6,53065P,7,43674P,6,9517P, 86679P,7,36974P,7,81778P,8,29483P,8,75988P,8,71587P,8,24182P,8,70187P,9,16392P,9,12991P,9,19492P,9,57596P,9,65797P, 10,08201P,10,45205P,10,52505P,10,48905P,10,9521P,10,89709P,11,37714P,11,81118P,11,32413P,11,76418P,11,83918P,12,18222P, 31723P,12,60526P,12,75128P,13,0423P,13,17132P,13,48935P,13,64836P,13,91039P,14,07141P,14,32843P,14,48945P,14,78548P,14,91149P, 15,20652P,15,33153P,15,62856P,15,75558P,16,0516P,16,19262P,16,48265P,16,61866P,16,91169P,17,05471P,17,33773P,17,48375P, 74677P,17,92079P,18,15782P,18,34183P,18,58086P,18,77388P,19,0069P,
0次請求失敗。
平均響應時間:9,20126
爲什麼結果如此糟糕,我試圖改變應用程序池工作進程計數,但沒有運氣,誰能告訴我缺少的是什麼,什麼是設置限制?
我在Windows Server 2008R2機器上使用WCF 4.0,IIS7.5。
謝謝
當然,這是一個併發問題。您沒有提及您用於ConcurrencyMode(默認爲單一)和其他設置。 –