What are the Pitfalls of using a shared static WCF Proxy Client?

醉酒当歌 提交于 2019-12-09 19:15:45

问题


I am considering using a Shared (read static) WCF proxy client for a high throughput application. I believe there is a performance gain in doing this, but I have not benchmarked this as yet.

Are there some serious pitfalls to this idea?

From my research I can see that there is the issue of handling the fault state, it is not clear what the flow on affect of this state would be to other pending requests.

Does anyone have any experience recovering a WCF proxy from it's faulted state?

thanks in advance!


回答1:


Once the channel is in a faulted state it will stay that way. So yes, I think a static client would be problematic. I started off that way as well but ended up creating and opening a new channel for each call instead. There doesn't seem to be much of a performance trade-off.

For reference I'm doing about 30-60 requests of about 5K-30K per request per second on a quad core machine from another quad core machine. WCF has been holding up quite well so far.




回答2:


I just discovered that calling Close() on the proxy will block when calls that are One Way operations executing [OperationContract(IsOneWay = true)]. This would change the flow as well.



来源:https://stackoverflow.com/questions/563525/what-are-the-pitfalls-of-using-a-shared-static-wcf-proxy-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!