具有多线程httpWebRequest的低带宽

时间:2013-02-24 06:17:58

标签: multithreading httpwebrequest bandwidth

我有一个使用httpwebrequest.beginGetResponse()以异步方式调用web服务的wcf服务。我的问题是,当我使用TPL(最大并发:300)从另一个服务调用它时,我的带宽下降,无法连接到互联网。 有没有人有一个很好的解决方案来限制这种不良影响?我已经尝试在配置中配置

<connectionManagement>
    <add address="*" maxconnection="2000" />
</connectionManagement>

但这不起作用

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

我明白了...... 在我的wcf服务中,我替换

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerSession)]

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)]

现在工作正常。谁有解释?

相关问题