Same ASP.Net application - Multiple IIS Sites - asp.net

A quick ASP.Net performance question...
I have an ASP.Net 3.5 SP1 Application that I want to run on IIS 6. For SSL certificate reasons I need to run it on separate sites in IIS. It's a CMS, and some clients will need the add their own SSL certs.
1) Can I run the same set of ASP.Net files on the disk on multiple sites in IIS or do I need to mirror them?
2) What considerations do I need to make in terms of performance, e.g. having multiple database connections from each site?? Or will they be 'pooled'?! Also, I am using Linq to SQL and am caching the results using ASP.Net's cache. Will it be an overhead to have separate caches for each IIS site of essentially the same data? Are there any other performance or application design considerations for this scenario?
3) Does running the IIS sites under the same App Pool make any difference?
Or does anyone have a totally different recommendations?
Any guidance you can give would be much appreciated. I'm looking for as many varied opinions and experiences as possible here, so please do add an answer if you can help.
Cheers,
Tim

Maintenance will be WAY easier if you only have one IIS site to manage. A more efficient way would be to deal with the SSL issue somewhere else (eg, hardware load balancer, content switch, Apache box, etc) and reverse-proxy to a single IIS instance with a single version of the app running. Sharing the app pools won't help (assuming you're using SQL Server with the managed client anyway), because each web app gets its own Appdomain and hence its own connection pool. Sharing app pools causes them to share a process, but not an appdomain.
I've done this on the cheap before by having Apache installed on the same machine as IIS, listening only on port 443 (for however many IP/cert combos were needed), then have Apache set up as a reverse proxy to IIS on the same machine listening only on port 80 (but for any host header).

I agree it does not make sense to run different web sites for the same applicaiton.
You can set SSL port in the web site with IIS manager. If you do not set IIS to require certificates, some users can use the HTTP version without the certificate error and the others can use SSL.

Related

Multi-host deployment of ASP.NET Core applications

I am quite confused as I haven't seen any blogs or instructions on how to host ASP.NET Core/.NET Core applications with HA and multi-host deployments. All examples are either:
1) One NGINX reverse-proxy, one Kestrel
2) One IIS reverse-proxy, one Kestrel
And both components on same host. In real-life production environments, you have LB maybe service discovery, multiple frontends, multiple backends, etc. But for this case there are no instructions whatsoever. So my questions would be for multi-host environments:
Do I deploy one IIS/NGINX as LB/Reverse-proxy, and redirect requests to Kestrels running on many separate VM:s, i.e. various different IP:s?
Or do I run an NGINX/F5 for load-balancing on one host, then route http traffic to various VM:s that run IIS+Kestrel, or just Kestrel? Is IIS required in this setup as NGINX acts as LB?
If I run IIS or NGINX as reverse-proxy, can they keep alive Kestrels on different VM:s, or does each Kestrel require exactly one IIS/NGINX to keep it alive? I.e. the Kestrel process must be on the same same host as the reverse-proxy?
All answers are very welcome, and thanks a lot in advance! :)
I'm running NGINX at the edge as a load balancer and for SSL Termination and multiple servers with IIS + Kestrel serving MVC. This is working well for us. You may not need it but I've found NGINX to be quite a bit more sophisticated and powerful than anything you could do with IIS. Obviously F5 or something would work as well. Previously I also ran for a while using AWS ELB load balancers which also worked fine, just didn't have much configurability. So depends on your needs.
As was mentioned already, IIS is needed on each box running kestrel to manage the process. You could do this some other way, but using IIS is the easiest.
I have a setup with one VM using (IIS as LB) + several VMs with (IIS + Kestrel). It's working fine for my usage, but I'm curious to see if other people have different suggestions. Then it depends on what you are doing, if you use encryption, machine key needs to be shared between VMs, you might also needs to share session between VMs (https://www.exceptionnotfound.net/finding-and-using-asp-net-session-in-core-1-0/), store things in database ...

Can we deploy the independent /separate web application on same server‘s IIS on which SharePoint applications are installed?

We have a Windows server 2008 with IIS on which SharePoint applications are installed.
Can we deploy the independent /separate web application on same server‘s IIS on which SharePoint applications are installed ?
Any help would be appreciated.
Yes, you can, though they'll need different virtual hosts (so that they're accessed through different URLs).
They can use the same IP address and port if you want, although they don't have to. If you're running multiple HTTPS sites, then each site will need its own certificate and will thus need its own IP address, but that's still possible with one server, just a bit more involved.
Yes you can as Thriggle suggested but make sure that you don't share the app pool of any SP web app with another web app, both for security and maintainability purposes.

Excluding a particular IIS website from the web farm environment

We have developed a website that uses In-Proc sessions, stores images uploaded from it on a folder inside its own virtual directory, and uses a third party tool that uses server side caching. This setup works just fine in a single server instance.
But the client has a web farm environment. When we deployed this site on client's web farm. Things started failing. Till now -
we have enabled out-proc session, using SQL state management server
we specified a machine key in the web.config of the server
But the other two, specially the third party tool, is proving difficult to crack.
Will it be possible to remove this one website from the web farm? excuse me if the question sounds naive but I am not a server administrator and not aware of its nitty-gritties
Will it work if we just deactivate one of the websites?
Can we deploy this website on one of the servers in the farm, but keep it outside the web farm's load balancing?
Is there any alternative, other than deploying the website on a completely different server?
Not sure on what vendor the balanacers are but the network admin should be able to setup a VIP (Virtual IP) that translates only to the once server in question.
That is a simple answer but there are many other variables in the network architecture that would have to be answered to accomplish this. I suggest you contact the administrator of the load balancers and ask them if you can isolate traffic for the website to the specified server.

IIS, EC2, Web Farm, Web Deploy and ELB

I'm a developer now developing my startup. I really don't know much about IIS setup. I will host my startup on Amazon EC2. And I want to know how can I scale my application if my traffic increase. I been reading about MS Deploy and Web Farm Framework here: https://serverfault.com/questions/127409/iis-configuration-synchronization-for-web-server-farm . And I want a simple architecture, with not to much configuration. So I been looking an experience with an IIS web farm and Amazon ELBs. And I did not find any one.
So the question is:
It is possible to make a IIS web farm with Amazon ELBs?
Any experience on Ec2? IIS web deploy or WFF and/or without ELBs?
What you recommend for an easy web farm setup?
You can do almost anything you want with IIS on EC2. They are full servers (well window 2k8 datacenter edition) and you can open any ports you need to communicate between servers. Here is an explicit tutorial on how to set up WFF, for example, on EC2.
The question is, are you sure you need to build a web farm? If you simply want to have multiple servers running your code then you can accomplish this without anything more than IIS and the tools that EC2 provides.
You build your app so it uses shared resources (like a session state server, central location for storing user uploaded content), configure a server the way you like it, and capture a server image (AMI). You use this image when you configure AutoScaling to launch new instances based on server metrics (like CPU usage), and they would be automatically added to the load balancer when launched.
The last challenge is ensuring servers launched automatically are running your latest code. You can write a custom program to get the latest code from somewhere (like SVN) on server startup, or you can use something much simpler like Dropbox to handle the synchronization.

How would you compare IIS & Cassini as production servers?

I have an ASP.NET website which is running currently on IIS. Now I want to move that site to run on Cassini.
What are the advantages of Cassini over IIS? What are its disadvantages?
What are your experiences using Cassini as a production web-server?
As far as I know, you cannot use Cassini in production because it listens for localhost requests only. You will have to modify source code and recompile the webserver by yourself.
Another thing is that IIS is built on top of http.sys kernel-level library for maximum performance. I'm not familiar with the latest Cassini versions but last time I checked, it used slower managed TCP sockets.
If your website is not very popular and Cassini has all the features you need, why not... there is nothing wrong with Cassini. It's simple webserver but it's not the only alternative to IIS.
There is Abyss, UltiDev Cassini and I think a few other open-source servers with ASP.NET support.
UltiDev Web Server Pro is a free, redistributable, light-weight web server with lots of enterprise-level feature for ASP.NET applications (from ASP.NET 1.1 to 4). Unlike Cassini, its design has nothing precluding it from serving Internet-facing applications. Created by UltiDev, the vendor of UltiDev Cassini fork, new UWS Pro is functionally closer to IIS than to Cassini. More screenshots.
.
Easy choice: it's simply not possible to use Cassini in production, because it's not accessible from remote machines (it only listens on localhost).
I would say you are better off, going with something proven to handle scaling, like mod_mono on apache if you are looking for alternative servers.
The integrated pipeline, routing, compression and caching features of iis are hard to replicate. But the app pool and failure rapid response stuff is hard to do without knowledge of the OS and the network stack at a root level.
Cassini doesn't claim to be multi threaded or handle any of the advanced e-tags or other header control issues that can be issues with iis, but are also usually set at sensible defaults in later versions of iis.
For the sake of completeness, you could do the older rails-mongrels model, spin up say 10 cassini's on ports 10100 - 10110, then use ngenx or apache to load ballance requests on those threads, and using a monitoring tool to redo requests to new threads when old ones go out to lunch and constantly be restarting 2 or so ports, because you get overloaded.
There is a good comparison of Cassini and IIS here at StackOverflow
There is no possible angle you can look at cassini or any of it's derivatives and consider using it as anything other than a development/testing server.

Resources