0

I am using WCF for IPC.

I have very strict performance needs, so the whole operation can take only a few milliseconds. (blocked by 3-4ms I'd say...) However, WCF open takes approx 10ms. I looked at some performance testings made and I saw I can get much better results, though I wasn't able to do so. I can just save an open connection, but I would really like to avoid it.

I already tried compiling in release, and removing security etc. (that only lowered it by the tiniest bit...)

This is my configuration (it's defined by code):

NetTcpBinding tcpBinding = new NetTcpBinding(SecurityMode.Message, false)
        {
            SendTimeout = TimeSpan.FromSeconds(1),
            ReceiveTimeout = TimeSpan.FromSeconds(1),
            OpenTimeout = TimeSpan.FromMilliseconds(500),// FromMinutes(1),
            TransactionFlow = false,
            TransferMode = TransferMode.Buffered,
            TransactionProtocol = TransactionProtocol.OleTransactions,
            HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
            ListenBacklog = ushort.MaxValue,
            MaxBufferPoolSize = 20 * 1024 * 1024,
            MaxBufferSize = 20 * 1024 * 1024,
            MaxConnections = ushort.MaxValue,
            MaxReceivedMessageSize = 20 * 1024 * 1024,
        };

        // Windows authentication
        tcpBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
        tcpBinding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;

        return tcpBinding;

Can anyone suggest anyway of improving this configuration? Thanks.

Roy Reznik
  • 2,040
  • 4
  • 22
  • 28
  • Well, you're using windows auth, and full encryption and signing. Do you actually need all that? would, say, basicHttpBinding running over SSL do the job? Maybe some TransportWithMessageCredential if you need auth? – Marc Gravell Jun 04 '12 at 10:53
  • I would add more: if you need the fastest times, maybe WCF is too much overhead. Have you considered, say, [servicestack](http://www.servicestack.net/)? – Marc Gravell Jun 04 '12 at 11:04
  • About the encryption & signing, as I said, I have tried removing the security completely, and it didn't change it by much. – Roy Reznik Jun 04 '12 at 11:14
  • About the ServiceStack - it's an interesting idea that I didn't know existed, is it really better performance-wise? – Roy Reznik Jun 04 '12 at 11:15
  • I've heard many many good things about it, **in particular** relating to the performance – Marc Gravell Jun 04 '12 at 11:16
  • Well, I have checked and the real problem is the "open" method. Opening a TCP connection is pretty lengthy. The named pipe binding gives much better performance (that I could have lived with), however, My scenario is on the same machine but contains one network impersonated user, and since Microsoft denies network users in its named pipe ACLs, It's of no use for me. – Roy Reznik Jun 04 '12 at 15:29

0 Answers0