Press OR poll

I have an SL client and a WCF service. A client checks for WCF every 4 seconds, and I have almost 100 clients at a time.

A web server is an entry-level server with 512 MB of RAM.

I want to know if polling depends on the server configuration, if I increase the server configuration, will polling work better for clients?

And secondly, will push (duplex) be better than polling? I have a mixed answer from the blogs I read.

Also, what are the best polling optimization techniques for faster customer response? My application needs real-time data

thanks

+4
source share
2 answers

I assume that you have some kind of race condition that only appears with a lot of customers. What concurrency and instancing modes are used for your WCF service? (See MSDN: WCF, Instancing, and Concurrency Sessions at http://msdn.microsoft.com/en-us/library/ms731193.aspx )

If you "lose" the answers, the first thing I would like to do is to start logging or tracing what happens on the server. For example, when the client "does not see" the answer, does the server receive the request? (If so, what happens to him, etc.)

I will also monitor the memory usage - you are not saying which OS you are using, but 512 MB is terribly skinny these days. If you ever encounter a swap-to-disk situation, this is clearly not a good thing.

Finally, assuming your service is CPU-related (i.e. there are no heavy database and file system queries), the best way to increase throughput is probably to reduce the message payload (wire size), use the most efficient bindings (i.e. if the client is .NET and you control it, NetTcp binding is much faster than HTTP) and, of course, multi-threaded service. IMHO, with the information you provided - and everything else is equal - the survey is probably fine, and a push can just complicate the situation. If this is important, you really want to bring a real engineering approach to the problem and identify / measure your bottlenecks.

Hope this helps!

+3
source

Push notifications usually have lower network overhead because traffic is not sent when there is no connection. But pull notifications often have lower application overhead, since you don’t need to maintain a state where the client is just idle, waiting for the notification.

Push notifications also tend to be β€œfaster,” because clients are notified immediately when an event occurs, rather than waiting for the next polling interval. But push notifications are more flexible - you can use almost any server or protocol you want, and you can double the capacity of your client by simply doubling the polling interval.

+1
source

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


All Articles