WCF 自托管服务比 IIS 托管选项处理更多还是更少的负载?
托管选项是否会影响 WCF 服务可以处理的请求量?
Does the hosting option affects the amount of requests a WCF service can handle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一旦服务运行,我预计不会有显着差异。
但是,与任何性能问题一样,您只能通过在两种情况下使用实际负载测试您的服务并查看全局来获得有用的答案。 例如,一个人可能会处理更多的请求,但内存成本会稍高一些。
当然,还会有其他差异,例如,具有按需实例化功能的 IIS 托管在处理空闲的第一个请求时预计会慢一些,这是否重要只有您自己才能判断。
Once the service is running I would expect no significant difference.
But, as with any performance question, you can only get a useful answer by testing your service in both cases with realistic loads and looking at the big picture. E.g. one might server a few more requests but at a slightly higher memory cost.
There are of course going to be other differences e.g. IIS hosting, with on demand instantiation, would be expected to be a little slower to serve the first request from idle, whether this is significant only you can tell.
一旦“Dublin”(专门构建的 WCF 托管环境)发布,使用它就很自然了。
编辑:这个答案最初是关于 IIS 和自托管之间由于线程差异而存在的潜在差异。 不过,我纠正了,请参阅下面的评论。
Once "Dublin" (a purpose built WCF hosting environment) is released, it will be natural to use that.
EDIT: This answer was originally about the potential difference between IIS and self hosted due to differences in threading. However, I stand corrected, see the comment below.
很难说 - 自托管的主要原因可能是拥有更多的控制权,例如能够根据需要调整系统。
IIS 托管方便且易于设置,并且它提供“按需”加载服务,例如,仅当请求实际进入时才加载服务主机。服务
主机的这种不断加载(和卸载)可能会性能会受到一点影响 - 另一方面,自托管服务主机,您可能会使用更多内存(因为 ServiceHost 始终处于活动状态并且位于内存中)。
再说一遍——这是内存与速度的权衡——自托管使用更多的 RAM,但速度可能会快一点。
马克
Hard to say - the main reason for self-hosting is probably having more control, e.g. being able to tweak the system as you need it.
IIS hosting is convenient and easy to set up, and it offers "on-demand" loading of the service, e.g. the service host is only loaded if a request actually comes in.
This constant loading (and unloading) of the service host will probably hurt performance a little bit - on the other hand, self-hosting a service host, you probably use more memory (since the ServiceHost is active and in memory at all times).
So again - it's a memory-vs-speed trade-off - selfhosting uses more RAM but is probably a tiny bit faster.
Marc