Question

How to achieve low latency of WCF server in publish-subscribe scenario? Specifically, clients subscribe to data and receive updates, latency in question is between data changing and client receiving the change? CPU, memory, bandwidth requirements are not important and can be high.

Basics are obvious: binary serialization, named pipes, etc. But does it makes sense, for example, to send data through always-connected stream? Or to send batch of updates as a single message to decrease RPC/header overhead?

May be there are some projects with code or interfaces available to use as example?

Was it helpful?

Solution

Not a comprehensive solution but: To reduce latency associated with size of data and network transfer speeds you could use google protocol buffers to compress your data over the wire. GitHub projects is here.

OTHER TIPS

If you use a duplex channel, you can have clients connect to the server and in doing so pass another service contract as a callback. The server then uses this callback to send updates to the client as they become available.

I've written an in-house pub-sub mechanism using this approach and latency is about as low as you would expect possible via WCF.

What is your target performance?

This MSDN article discusses using a WCF duplex channel.

Have you looked at

http://geekswithblogs.net/BVeldhoen/archive/2008/01/26/wcf-latency-test-harness.aspx

It takes into account various bindings, and data sizes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top