出于性能原因,使用 httphandlers、asmx、wcf 进行 JSON 服务?
我需要构建一个可以处理相当简单的 JSON 消息的服务(总共大约有十几个操作)。然而,我预计会有大量的使用,因此我希望获得最大的性能和最小的开销。
将其构建为 HTTPHandler 有意义吗?它会比 ASMX 或 WCF 明显/可量化地提高性能吗?
I need to build a service that would handle fairly simple JSON messages (about a dozen operations total). I'm anticipating a huge amount of usage, however so I want maximum performance and minimum overhead.
Would building this out as an HTTPHandler make any sense? Would it be appreciably/quantifiably more performant than ASMX or WCF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
越接近实际的 HTTP 请求,WCF 等框架的开销就越少。所以 HTTPHandler 是有意义的。
现在这是否真的重要是另一个问题了。网络开销很可能会更大,并且您不会看到客户端的性能有很大差异。如果负载很大,您可能需要 WCF 限制行为,以避免峰值负载使服务器过载,
The closer you get to the actual HTTP request the less overhead you will have from a framework like WCF. So an HTTPHandler makes sense.
Now if it really matters is another question. The network overhead is most likely going to be much larger and you are not going to see a big difference in performance from a client. And with a big load you might need the WCF throttling behaviors to avoid overloading your servers with peak loads,