problem with HttpWebRequest.GetResponse perfomance in multithread applcation

Posted by Nikita on Stack Overflow See other posts from Stack Overflow or by Nikita
Published on 2010-06-05T20:10:51Z Indexed on 2010/06/05 20:12 UTC
Read the original article Hit count: 236

Filed under:
|

I have very bad perfomance of HttpWebRequest.GetResponse method when it is called from different thread for different URLs. For example if we have one thread and execute url1 it requires 3sec. If we ececute url1 and url2 in parallet it requires 10sec, first request ended after 8sec and second after 10sec.

If we exutet 10 URLs url1, url2, ... url0 it requires 1min 4 sec!!! first request ended after 50 secs!

I use GetResponse method. I tried te set DefaultConnectionLimit but it doesn't help. If use BeginGetRequest/EndGetResponse methods it works very fast but only if this methods called from one thread. If from different it is also very slowly. I need to execute Http requests from many threads at one time.

?an anyone ever encountered such a problem? Thank you for any suggestions.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET