G
Guest
Hi
I'd like to know whether it's beneficial to multi-thread web request calls
Experimentally, it doesn't look very helpful. I measured the time it takes to make request to a certain website from a C# application, and doing it serially 10 consequtive calls took about 20 seconds (2 seconds each, average)
Then, I tried spawning off 10 different threads, each making a single request. The first thread finished in 2 seconds, the second one in 4 seconds, etc. The total time came out to be around 16-17 seconds. While I expected all the calls to complete in vicinity of 3-5 seconds
Does that mean, that an underlaying protocol still serializes all my requests? Is is the web server that I am dealing processes everything serially? What am I missing
This is how I access a web site
WebRequest oRequest = WebRequest.Create(szUrl)
WebResponse oResponse = oRequest.GetResponse()
Thanks
VR
I'd like to know whether it's beneficial to multi-thread web request calls
Experimentally, it doesn't look very helpful. I measured the time it takes to make request to a certain website from a C# application, and doing it serially 10 consequtive calls took about 20 seconds (2 seconds each, average)
Then, I tried spawning off 10 different threads, each making a single request. The first thread finished in 2 seconds, the second one in 4 seconds, etc. The total time came out to be around 16-17 seconds. While I expected all the calls to complete in vicinity of 3-5 seconds
Does that mean, that an underlaying protocol still serializes all my requests? Is is the web server that I am dealing processes everything serially? What am I missing
This is how I access a web site
WebRequest oRequest = WebRequest.Create(szUrl)
WebResponse oResponse = oRequest.GetResponse()
Thanks
VR