ASP.net solution considerations for multi server deployment - c#

I've done all my development of an ASP.net website under the assumption that it will be deployed to a single server. Since we're expanding we're looking at hosting scalably in the cloud with multiple VM's running the website. We are taking expert advise on deployment, but the hired help we have are expecting an ASP.net site that will work in a load balanced environment.
I'm researching what in my solution may need to change for it to work on a multi server deployment.
So far, I've found that all my caching needs to be done on a distributed cache such as NCache. The code changes required for this don't look too bad.
We don't use sessions for user authentication, it's all done via cookies so I don't think that will cause any issues.
What other general considerations need to be made? (I've looked for a guide but can't find one).

If you use sessions to store data between calls, you are going to need to move to the SqlServerSessionProvider. you'll also need to have the same machine key for all servers on the load balancer or viewstate won't work.
Here's a link from Scott Hanselman that list the gotchas.

Related

Analytics in a restricted environment

Does anyone know of an analytics package, either open source or commercial, that can be integrated into a corporate MVC3 site running in a restricted environment?
The (rather rigid) requirements for my project are: -
The solution must be installed locally, which sadly rules out Google Analytics.
The solution must track analytics for individual users / customers.
The solution must work on a Microsoft technology stack and work under IIS 7.5.
Unfortunately due to client sensitivities (I.E., security and brand reputation) they cannot use publically analytics packages and thus rule out Google, Open Web Analytics, etc.)
Thanks, and let me know if I need to make the requirements clearer.
Piwik is one of the best open source Web Analytics solution. I understand you need a solution in Microsoft stack but this is based on PHP.
I am using this to tracking SharePoint web applications and I am running Piwik using IIS 7.5.
Configure IIS to use a detailed log. Then use a IIS log analayzer tool (there is plenty, google).
http://awstats.sourceforge.net/ is pretty popular. (PHP, but easy to configure in a separate website in IIS)
A .NET based analyzer: http://www.iis.net/community/default.aspx?tabid=34&i=1864&g=6

Caching ASP.NET Pages on Azure

Are there any special considerations when Caching ASP.NET Pages on Azure?
I understand that page caching is managed in memory by IIS, but does it rely on the same providers as asp.net caching?
I need to cache hundreds of pages each averaging 100KB and I wonder if this will function on Azure as expected because there is a memory limitation considerations on Azure.
I'd recommend Azure Cache services for Output Caching ASP.NET pages. It's simple to configure and can be used by all VM nodes in your deployment.
Azure Cache relies on DistributedCacheOutputCacheProvider. You can also control your Cache Quota size.
Completely agree with #SilverNonja comments however I just wanted to comment about "Memory limitation consideration on Azure". I don't consider your objective is limited due to the limitation in Windows Azure memory because you sure can get a lot in single VM however can u server that many user from one single VM. You really have to run multiple instances of same application and then having the local machine specific cache is the problem.
With Cloud solution where you have more then one instances are running creating a local cache based solutions bring several problems because the requests are being served by different instances at different times. Having a centralize location for shared resources is the best where all the instances can look for the data is the best method and that's why Windows Azure Cache is the best/fast option available for you to use.
Also here is very Simple Sample to use Azure Cache with ASP.NET application:
https://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/
You might wanna try the latest Windows Azure Caching (Preview). It has a better feature set and improved latencies. For more info - http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/9a2dbd9f-1b9d-4249-a48b-216d9dfdc2bc

Integrate an E-Mail server into ASP.NET

I've a general design question:
I have a mailserver, written in C#.
Then I have a web forum software, written in for ASP.NET in C#.
Now I'd like to integrate the mailserver into the ASP.NET forum application.
For example, I'd like to make it possible that one can create a mailinglist from the forum, and give users the oportunity to add oneselfs to the mailinglist members in the forum, and then add the new list-members to the respective mailinglist on the server.
Since the server is a separate console/winforms/service application, I first thought I'd best use .NET remoting for this.
But my second thought was, that some users might host their forum on a host where
(a) they don't have a virtual machine where they can do what they want
(b) the admin of the host might not want to install an additional mailserver or charge extra for this
(c) the user might have a service plan that only permits to add a web-application, not external programs (very likely)
Now, I wanted to ask:
Is it possible to fully integrate a mailserver into an ASP.NET application somehow ?
(I have the full source of the server + ASP.NET application)
Well, it probably won't be a page or a ashx handler, but something like a http module ?
Or what's the general way to integrate TCP/IP applications into asp.net ?
(Of course I'm assuming the respecive ports are available/forwarded - and I'll make it possible to also run it with the e-mail server as external application)
In the ideal case I'd do the following:
Set it up on your own server(s) and expose a WCF/web service that your web app will/can interact with.
If you can't or don't want to afford to keep it running on your own, you could then charge a subscription fee for it.
It's probably not a very great idea, but you can start a thread in Global.asax and do background processing while the application pool is running/the web app is not reloaded. So you could start your server there, but you have no control over the lifetime of it
Adding to chris166's comment... you also wouldn't get control over when the application is started. [Since the application won't be loaded until a page is requested...] Its probably a better idea to setup some sort of integration between the web app and the console/service app.
I'd probably tend towards setting up a near-realtime integration where the mailserver polls the forum app for requested changes.

Live, shared hosted, ASP.NET MVC site migration to Windows Azure

I have an existing ASP.NET MVC based website. Very typical: XHTML, CSS, jQuery, C#, LINQ2Sql. Web.config tells app where to connect for SQL database.
Are typical websites like this easy to port to Windows Azure? What sort of headaches should I be ready for if I decided to do this?
It's not necessary at this time, but I'm planning for when I need to get the site ready for scaling. Thanks in advance!
i just found these two links that seem helpful for ASP.NET. Plus two more for SQL Azure.

Publishing a .NET C# website to an external server

I have just completed my first aspx/c# project using Visual Web Developer Express and consuming some custom controls and external web services. It runs fine on my development machine.
If I now want to test this on a shared hosting account, do I just upload all the files with the current project structure? Will there be any problem uploading the DLLs to a shared Windows hosting account? Anything I should be aware of or changes to be made to the code? Can anyone recommend a cheap and good provider (this is just for testing - no mssql required yet).
Thanks!
Does visual web developer have a "publish website" menu item under the Build menu?
If you want to pre-compile your site and publish it with all dependencies the easiest way I've found. You can then choose to publish it to either an FTP site or the file system. I usually choose the filesystem and then FTP it up myself to make sure I don't overwrite any config files.
If I'm working on a low volume site for a client and performance isn't a problem, I'll just upload my working directory right up to the server so I don't have to deliver the source code separately and I know they won't loose it.
Oh, and one other thing, if you don't configure it special, I would expect you will have to upload your site to the root directory of your hosting account. GoDaddy does have the ability to specify certain directorys as their own ASP.NET application. If you do that you can put your app in a sub-dir of your choosing.
-Al
It would depend on your website provider. You need to get one that supports the .NET runtime. Once you have that, then you simply upload your code and all should work. I personally use www.godaddy.com. You can see an example ASP.NET site hosted by them at www.chessbin.com.
I hope this helps.
Adam
The hosting companies may vary on what they require, but I would think a simple xcopy deploy would be sufficient for most. Here's a link to one that seems to have good prices (disclaimer: I have never used them)
http://www.reliablesite.net/v3/index.asp

Categories