Note that there are some explanatory texts on larger screens.

plurals
  1. POWcf parallel and async call?
    text
    copied!<p>I have a wcf service (parser service, byte[]=>string) </p> <pre><code>[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)] </code></pre> <p>hosted on iis (nettcpbinding) On my client side i have one million+ byte[] like this List(1000000) and i should call wcf service's method as parallel for parsing this list. </p> <p>I used like this but i have a bottleneck (wcf service not response to me) after the 500000-700000 message parsing. Where i do make wrong implemantation? Does it solve my problem if i implement this <a href="http://blogs.msdn.com/b/rjacobs/archive/2011/06/30/how-to-implement-a-wcf-asynchronous-service-operation-with-task-lt-t-gt.aspx" rel="nofollow">http://blogs.msdn.com/b/rjacobs/archive/2011/06/30/how-to-implement-a-wcf-asynchronous-service-operation-with-task-lt-t-gt.aspx</a> method (client side in Parallel.Foreach same below line ) </p> <pre><code>Service1 client =new Service1(); Parallel.Foeach(list,byteArray=&gt;{ var result = client.Parse(byteArray); string keyHash = string.combine(byteArray[0],byteArray[1],byteArray[3]) WriteDiffFile(keyHash,result); // maybe call in different task WriteSameFile(result); // need lock for write to same file }); </code></pre> <p>my wcf host configuration:</p> <pre><code>&lt;system.serviceModel&gt; &lt;diagnostics etwProviderId="9a712944-02ea-425a-bbd3-567a943b85df"&gt; &lt;endToEndTracing propagateActivity="false" messageFlowTracing="false" /&gt; &lt;/diagnostics&gt; &lt;services&gt; &lt;service name="Pln3G.Services.EventParserService" behaviorConfiguration="Pln3G.WebServices.EventParserServiceBehavior"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="net.tcp://localhost:8001/pln3g/EventParserService/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint address="" binding="netTcpBinding" bindingConfiguration="tcp_Unsecured" contract="Pln3G.Domain.Contracts.Service.IEventParserService" /&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;bindings&gt; &lt;netTcpBinding&gt; &lt;binding name="tcp_Unsecured" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" portSharingEnabled="false" transactionFlow="false" listenBacklog="2147483647" closeTimeout="00:01:00" openTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:10:00"&gt; &lt;readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="None"&gt;&lt;/security&gt; &lt;/binding&gt; &lt;/netTcpBinding&gt; &lt;/bindings&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="Pln3G.WebServices.EventParserServiceBehavior"&gt; &lt;etwTracking profileName="ErrorsOnly Tracking Profile" /&gt; &lt;dataContractSerializer maxItemsInObjectGraph="2147483647" /&gt; &lt;!--1. MaxConcurrentSessions: default is 100 * ProcessorCount 2. MaxConcurrentCalls: default is 16 * ProcessorCount 3. MaxConcurrentInstances: default is the total of MaxConcurrentSessions and MaxConcurrentCalls --&gt; &lt;serviceThrottling maxConcurrentCalls="32" maxConcurrentSessions="200" maxConcurrentInstances="232" /&gt; &lt;serviceMetadata httpGetEnabled="True" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="True" /&gt; &lt;/behavior&gt; &lt;behavior name=""&gt; &lt;etwTracking profileName="HealthMonitoring Tracking Profile" /&gt; &lt;serviceThrottling maxConcurrentCalls="32" maxConcurrentSessions="200" maxConcurrentInstances="232" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; </code></pre> <p>my wcf client configuration:</p> <pre><code>&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;netTcpBinding&gt; &lt;binding name="NetTcpBinding_IEventParserService" closeTimeout="00:01:00" openTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536"&gt; &lt;readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;!--&lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /&gt;--&gt; &lt;security mode="None"&gt; &lt;transport clientCredentialType="None" protectionLevel="None" /&gt; &lt;message clientCredentialType="None" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/netTcpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="net.tcp://192.168.1.66:8001/pln3g/EventParserService.svc" behaviorConfiguration="ServiceViewEventBehavior" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IEventParserService" contract="EventParserServiceReference.IEventParserService" name="NetTcpBinding_IEventParserService" /&gt; &lt;/client&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="ServiceViewEventBehavior"&gt; &lt;dataContractSerializer maxItemsInObjectGraph="2147483647"/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload