同一端口上 WCF 服务的性能
我有 2 个 WCF 服务通过同一个 TCP 端口。
这两种服务都是自托管的,一个附加到 net.tcp://localhost:8700/DataAccess
另一个附加到 net.tcp://localhost:8700/Messages
我可以吗通过将它们连接到不同的端口可以获得任何性能吗?其中一项服务非常繁忙,每秒发送兆字节的数据。有什么理由有或没有这种配置?
I have 2 WCF services going through the same TCP port.
Both services are self-hosted, one attaches to net.tcp://localhost:8700/DataAccess
another to net.tcp://localhost:8700/Messages
Will I gain any performance by attaching them to different ports? One of the services is very busy sending megabytes of data every second. Any reason to have or not to have this kind of configuration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如我在评论中提到的,我认为如果您在单独的端口上托管服务并关闭端口共享,性能提升可能会非常小。 端口共享由单独的 Windows 服务完成,该服务侦听共享端口和路由向服务托管应用程序发出请求。这种托管是另一种进程间通信,据我所知,它是使用命名管道完成的。因此,如果您关闭端口共享,您应该会降低通信的复杂性并获得一些性能提升,但它会非常小。
As I mentioned in my comment I think there can be very small performance boost if you host services on separate ports and turn off port sharing. Port sharing is done by separate Windows Service which listens on shared port and routes requests to the service hosting application. This hosting is another interprocess communication and as I know it is done using Named pipes. So simply if you turn off port sharing you should reduce complexity of communication and get some performance boost but it will be really small.
不,您不会通过在不同端口托管来获得性能优势。端口是路由公式的一部分,它们并不代表“带宽槽”。
No, you will not gain a performance advantage by hosting at different ports. Ports are part of a routing formula, they do not represent "slots of bandwidth."