Optimize WCF latency?
I 'm designing a distributed system and I deploy it on 1Gb cluster of Windows Server 2008 R2 But I have开发者_运维技巧 issue with the latency, the normal Ping() done via .NET takes 0.240ms, but WCF latency is about 0.500ms and I believe this is too high, since all the machines connected locally via one 1Gbs switch. So how I can improve WCF latency.
I use TCPBinding, ProtocolBuffer with WCF
Ping is just low level ICMP protocol defined in internet layer whereas TCP is more complex protocol defined in transport layer. ICMP is unreliable datagram protocol whereas TCP is reliable protocol with much higher transmission overhead especially for establishing connection.
WCF sits on top of net.tcp with its own channel stack which again has overhead. Unless you show very detailed description how you tested the communication your post is not a real question.
Also just small clarification: You are saying that you don't like latency of 0.5ms = 0.0005s??? It means that ping shows you < 1ms. It looks almost unrealistic even if devices are in the same network! If you mean that you have latency 0.5s then I should start with diagnosing ping latency 0.24s because that are values for pinging server on another continent. I have 0.024s ping to google (probably server in Europe) and 0.124s to yahoo.
精彩评论