1

Is there a limit to the number of concurrent HttpWebRequests .NET will allow at one time?

Steven
  • 4,637
  • 3
  • 34
  • 44

2 Answers2

2

I'm not sure of an overall limit, but there's certainly a limit to the number of concurrent connections to a single host name.

It can be configured in the <connectionManagement> element of app.config.

Jon Skeet
  • 1,335,956
  • 823
  • 8,931
  • 9,049
2

As Jon explained, the limit can be set in config. But you can also change it at runtime by setting the ServicePoint.ConnectionLimit for a specific ServicePoint, or the ServicePointManager.DefaultConnectionLimit static property (will apply to service points created after you set it). The default value is 2 connections per service point (DefaultPersistentConnectionLimit constant)

Thomas Levesque
  • 278,830
  • 63
  • 599
  • 738