user1026857
user1026857

Reputation:

WCF is very slow

I have got a functionality which returns 60,000 objects. An object contains only few properties. This functionality works in couple of seconds if I execute it on non-wcf mode in my local machine. But it takes over 30mins to execute on WCF mode in the local machine with below binding.

Does anyone have any idea on improving the performance of this in WCF mode? Thanks!

   <binding name="ReliableBindingConfig" closeTimeout="00:20:00" receiveTimeout="00:40:00" openTimeout="00:20:00" sendTimeout="00:40:00">
      <transactionFlow />
      <reliableSession maxRetryCount="12" ordered="true" inactivityTimeout="00:40:00" />
      <mtomMessageEncoding maxBufferSize="2147483647" maxReadPoolSize="2147483647" maxWritePoolSize="2147483647">
        <readerQuotas maxDepth="32" maxBytesPerRead="4096" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxNameTableCharCount="16384" />
      </mtomMessageEncoding>
      <httpTransport maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" />
    </binding>

Upvotes: 1

Views: 774

Answers (1)

Russell
Russell

Reputation: 17719

Adjust your maxBufferSize and maxBufferPoolSize to optimise the buffer sizes.

Too big and your service will be too busy loading all of the objects into memory. Too small and there will be too much network traffic and will slow it down.

You could write a simple test harness to record the time taken to find the optimal buffer size.

Upvotes: 1

Related Questions