Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm developing an asp.net application which let users create their own subdomain. the app creates the subdomains in IIS and it works.

But i think i have two options to do this and i want to know the pros and cons of each option.

1) Create a a new website and binding for each subdomain.

2) Create 1 website for the application and add a new binding for each new subdomain.

I am now using option 1, potentially creating hundreds of websites all pointing to the same app. Though they all use the same app pool i'm not sure it's a good idea performance wise.

share|improve this question
    
When you say all pointing to the same app do you mean these sites are literally pointing to the exact same folder? Or are you creating a copy of some general application (e.g. Wordpress, Drupal, etc.) and then giving each user their own application folder? –  Ek0nomik Mar 13 '12 at 15:19
    
Yes all pointing to the same folder. 1 app (no cms, a custom app), 1 folder, 1 database. Though i do create a 'data' virtual folder pointing to a folder created for each user, but i could solve that in another way. –  Jeroen Mar 13 '12 at 15:32
add comment

2 Answers

up vote 1 down vote accepted

why do either, just use a wildcard DNS entry to point all subdomains to the same IP/IIS site/binding and let your custom application logic work it out?

share|improve this answer
    
That way i can have www point to the app for my website and all the rest to my business app? –  Jeroen Mar 15 '12 at 23:00
    
Don't see why not. If you control the code on the business app, just have it react to the incoming URL rather then IIS. –  Bret Fisher Mar 15 '12 at 23:29
add comment

If it's just one application I am assuming that one user can't make a major impact on the performance or stability of the site. If they can, then you may want to use different sites with different application pools as the application pool will isolate the memory, threads, etc.

With that same assumption, since all the sub-domains are pointing to the exact same application, it sounds like one website with additional bindings is the correct way to go. This way you are telling IIS that your various domains should be routed to your one application.

share|improve this answer
    
Thanks. Do you know if creating multiple websites with 1 binding or creating 1 website with multiple bindings (same app pool, same app) makes a huge difference in perfomance and memory overhead? –  Jeroen Mar 13 '12 at 16:07
    
It really depends on how much your application is doing. I don't know for sure, but I imagine just by having an application pool running you're going to be using a small amount of memory (in the megabytes) and you'll have a thread running. Another thing to consider is security with multiple application pools. As an example, if you're using one application pool the cached data is available to all other applications in the same pool. –  Ek0nomik Mar 13 '12 at 16:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.