Poor performance WCF netNamedPipeBinding

I use the WCF service with netNamedPipeBinding to transfer a large amount of data (a very long list of objects) to the client (which is on the same machine, out of course). The problem is that it takes about 20 seconds for an entire call to transfer ~ 250 MB of data, which is about 10 MB per second. I expected that the transfer speed would be much faster when exchanging memory. Does anyone know how I can improve my performance and transmission speed? Here is my app.config file:

<netNamedPipeBinding> <binding name="NetNamedPipeBinding_IDataService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> <security mode="Transport"> <transport protectionLevel="None" /> </security> </binding> </netNamedPipeBinding> 

Thanks a lot!

+4
source share
1 answer

Like comments, this is most likely not the transfer rate causing the problem, but rather serialization.

There are 3 things to consider:

  • CPU usage for serialization and deserialization
  • saving objects in memory
  • transmission speed

To send 250 MB, it will first be serialized, then sent, then deserialized. This can lead to 3 copies of data in memory, which can lead to a disk break.

We had a similar problem a few years ago, and in the end I switched to calling the DLL directly, transferring the memory link to the list will take approx. 1 millisecond

+1
source

Source: https://habr.com/ru/post/1393033/


All Articles