且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WCF 对大量客户端用户的扩展能力如何?

更新时间:2023-02-25 19:06:15

为了确保您的 WCF 应用程序可以扩展到所需的级别,我认为您可能需要调整您对服务必须满足的统计数据的看法.

To ensure your WCF application can scale to the desired level I think you might need to tweak your thinking about the stats your services have to meet.

您提到为1000 多个客户端用户"提供服务,但要衡量您的服务是否可以在该级别执行,您还需要一些估计的使用数据,这将帮助您计算一些更简单的统计数据,例如每个请求的数量第二个您的应用需要处理.

You mention servicing "1000+ client users" but to gauge if your services can perform at that level you'll also need to have some estimated usage figures, which will help you calculate some simpler stats such as the number of requests per second your app needs to handle.

刚刚完成 WCF 项目的工作,我们设法在测试硬件上每秒收到 400 个请求,结合我们预期的每个用户每天发出 300 个请求的使用模式,这表明我们平均每天可以处理 100,000 个用户(假设全天的使用情况图平坦).

Having just finished working on a WCF project we managed to get 400 requests per second on our test hardware, which combined with our expected usage pattern of each user making 300 requests a day indicated we could handle an average of 100,000 users a day (assuming a flat usage graph across the day).

此外,由于使 WCF 服务代码无状态是相当普遍的,因此通过添加额外的框来扩展实际的 WCF 代码非常容易,这意味着您的系统的整体性能更有可能受到您的限制业务逻辑和持久层不是 WCF.

In addition, since it's fairly common to make the WCF service code stateless, it's pretty easy to scale out the actual WCF code by adding additional boxes, which means the overall performance of your system is much more likely to be limited by your business logic and persistence layer than it is by WCF.