在最近的開發中,總是發現人數一多就會有使用者莫名其妙的界面卡死,或者直接掉線的情況,不知道是什麼原因,由于項目采用的是netTcp綁定,猜想可能是并發連接配接的問題。于是查了一下:
在windows7中,并發連接配接數預設是10
代碼
<binding name="netTcpBindConfig" closeTimeout="00:30:00"
openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10"
maxReceivedMessageSize="2147483647">
将項目移植到windows server2008上之後,并發連接配接數需要改變一下,于是變成
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="1000"
但是問題依然存在,就想到是不是需要配置一下行為,于是将行為的連接配接數量也改變了
<behavior name="JXSoft.JPlan.WCFService.Behavior" >
<serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000"/>
<serviceMetadata/>
<serviceDebug includeExceptionDetailInFaults="true" />
<dataContractSerializer maxItemsInObjectGraph="6553600"/>
</behavior>
問題解決,沒有再出現過卡死或者掉線情況.