Sunday 15 August 2010

c# - How to force .NET to open many simultaneous http connections -


Here's a very simple scenario that I would like to show:

  Internal class program { Private static zero main (string [] args) {var uri = new uri ("http://myserver.com"); ServicePointManager.FindServicePoint (Yuri) Connection Lenin = 1000; (Web site), (for example i = 0; i & lt; 1000; i ++). (WebRequest.Create (uri). Baggent Response (a = & gt; {}, tap);} console. "Row" ("done" ); Console.ReadLine ();}}   

and related App.config:

  & lt; system.net & gt; & lt; connectionManagement & Gt; & lt; clear / & gt; & lt; add address = "*" Maximum Connection = "1000" />  
DefaultProxy & gt; & lt; Proxy ProxyDress = "Http://127.0.0.1:8888" /> & lt; / defaultProxy & gt; & lt; /system.net>

Say myserver.com for 10 seconds Answers (I make it in Fiddler via AutoSponder). < / P>

In the proxy server (fidler) I only send 14 HTX requests when the application is started then the number of active connections is increasing but is very slow, work in 1-2 seconds in about 1-2 seconds After 1 minute the number of active http requests is approximately 50, but not 1000.

Is there any configuration that I can change to apply to the .NET to open 1000 real HTTP requests , But at least 200-300?

I think the best solution is to open each connection from the new thread < P> .NET 4 32-bit system in .NET 4 64-bit system has a limit of thresholds in 32768

If it does not work at the least, then you will be sure that there is a code in your code nothing is wrong.

No comments:

Post a Comment