views:

23

answers:

1

Hello,

I was considering having a sub "web application" in my asp.net (4.0 C#) web application (using the same application pool). E.g. for a blog application so I may keep things separate.

  1. How much additional resources of the server does a sub-application take? Or rather how much resources (excluding the app pool) does a web application take?
  2. How can I inherit from the parent web applications web.config.

Note: I am considering having 10 sub applications per web site (well web application really) and wanted to know whether this would cause a big drain on resources or not.

Thanks, Dan.

A: 

It depends on how these web applications behave, how much memory they consume and the amount of traffic hitting them.

Each application will reside in its own Application Domain. An application sitting idle could consume as little as a few Kb of memory. But if it's caching data or allocating lots of memory this could balloon. I think you need to profile these applications under different scenarios to be able to accurately predict these metrics.

With regard to inheriting web.config settings, just add a web.config to each application to provide application specific settings. You need to watch out for things like custom HttpModules and HttpHandlers that your root application may use but your sub-applications don't. You might need to add <remove> or <clear> tags where appropriate to prevent ASP.NET trying to load these non-existant handlers in your applications.

To answer the questions in your comment:

So basically a sub application will consume as much resources as is programmed. Does a application + application domain have a minimum resource demand when in use?

I can't give a precise figure for the minimum foot-print of an application+ app domain overhead, but it's can be as little as 4-5kb depending on size of the application and whatever upfront memory allocations it makes.

Also, if I have a connection string in the parent web.config, will that be inherited in the sub app?

Connection strings will be inherited by default. If you're using ASP.NET 4.0 and if there are whole sections of the parent web.config that you don't want inherited you can use the <location> tag along with the inheritInChildApplications attribute:

location Element (ASP.NET Settings Schema)

How to stop inheritance of Web.Config files

Kev
Thanks for the response. So basically a sub application will consume as much resources as is programmed. Does a application + application domain have a minimum resource demand when in use? Also, if I have a connection string in the parent web.config, that will be inherited in the sub app right?
Dan B
@DanB - see my updated answer
Kev
@Kev Super! I'll experiment tonight and let you know how I get on.
Dan B