0
我有一个nettcpbinding wcf服务。它在一秒内调用100000+次,所以有更多关于性能的问题。我必须优化这一点。我如何实现这个nettcpbinding配置的CustumBinding配置
我的第一个问题是:新接受的连接没有从配置的ChannelInitializationTimeout(00:00:05)内的发送方接收初始化数据。结果,连接将被中止。如果您处于高度拥塞的网络中,或者发送的计算机负载过重,请考虑增加此值或对服务器进行负载平衡。
我应该使用CustomBinding设置ChannelInitializationTimeout。我阅读了一些示例,但没有实现配置。
如何实现下面的配置到自定义绑定配置?
<?xml version="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning" propagateActivity="false">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="E:\Services\Ozy3\logs\EventParserService.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
<system.web>
<compilation debug="true" />
</system.web>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.serviceModel>
<services>
<service name="Ozy3.Services.EventParserService" behaviorConfiguration="Ozy3.Services.EventParserServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:3274/EventParserService" />
</baseAddresses>
</host>
<endpoint address="net.tcp://localhost:3273/EventParserService" binding="netTcpBinding" bindingConfiguration="tcp_Unsecured" contract="Ozy3.Domain.Contracts.Service.IEventParserService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="tcp_Unsecured" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" portSharingEnabled="false" transactionFlow="false" listenBacklog="2147483647"
closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Ozy3.Services.EventParserServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceThrottling maxConcurrentCalls="32" maxConcurrentSessions="200" maxConcurrentInstances="232" />
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
你好。您是否设法为您的问题找到任何解决方案,因为如果您可以分享它,我可能会感兴趣。谢谢 –