views:

543

answers:

3

I'm writing an ASP.NET web application which will run on Windows Server 2008 (IIS7).

Each page's codebehind will need to make at least one synchronous web service call to an external server using HttpWebRequest and GET.

My question - is there any limit to the number of outbound HttpWebRequest calls I can make? (assume that the server I'm calling has no limit)

Is there any means to pool these connections to make the app scale better? Would a web garden configuration help?

+1  A: 

I think your question should be geared toward network configurations.

I'd say you are asking for trouble if every page is dependent on a synchronous external call. What if you get N number of request that get hung on the external web service(s)? You will have some issues on your end then and you can do nothing about it.

Have you considered async calls with callbacks?

EDIT: Asynchronous Pages in ASP.NET 2.0

rick schott
Will async calls work when called from an ASPX page's codebehind?
frankadelic
That is a loaded question, but I added a link that has an example that should get you going.
rick schott
A: 

By default, an HTTP/1.1 server is limited to two connection, and a HTTP/1.0 server is limited to four connections. So, your ASP.NEt app will have serious throughput problems if you are trying to issue more than two outstanding requests to an HTTP/1.1 server, for eg.

You will need to increase the connection limit, either per server, or globally.

For eg, globally:

ServicePointManager.DefaultConnectionLimit = 10; // allow 10 outstanding connections

Hope this helps.

feroze
A: 

The following link points to a really great article for optimizing Asp.net.

http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx

Hope it helps ;)

Hemanshu Bhojak