Asp.net mvc app on a shared host move to Windows Azure during peak load possible? - asp.net-mvc

I have an ASP.NET MVC web application that is hosted on a shared hosting account. The site has no issues during regular usage. However the nature of the business is such that for one week out of the month we have very very high traffic. During these high traffic peak load times, my application has several "Service Unavailable".
One of the possible solutions I am looking at is to spin up a Windows Azure web role during peak traffic week and spin it down again after the week is up. (I know exactly when the load is going to be high) Right now, we don't have enough revenue to justify moving the site permanently to the cloud.
My questions is how to I handle DNS. I would like the move to Azure and back to hosted service to be seamless to the user. The user should be able to type my normal URL and go to my hosted site during off peak weeks and to the cloud app during peak week. My guess is to add some kind of CNAME record to the DNS server but I have no idea how to go about doing this. Anybody know of any resources on how to update the DNS so this scenario would work?

Yup, a CNAME record sounds to me like the way to go. See http://blog.smarx.com/posts/custom-domain-names-in-windows-azure. (Sorry, one of the images looks broken... I'll try to patch that up.)
The scheme would be: have www.foo.com point to your current app instance, and then change it to point to something.cloudapp.net when that week comes up... then switch it back after the rush is over.

Is it possible to just have the MVC site hosted on another web hosting account permanently? It doesn't necessarily have to be an Azure account, does it? Is the site written in MVC1 or MVC2?

If your shared hosting server cannot handle the peak then 1 instance of the web worker role in Azure probably won't work either.
I would try something else: keep your asp.net code on that server but move all the static content somewhere else (for example the Azure CDN) using a subdomain. If you use Jquery and serve the file from your website then you can change the link to either Google's CDN or Microsoft's CDN already for free.

Related

Make the Web App on Azure portal only Available few hours in a Week

I am building a ASP.Net Core Web App which I am trying to host in the Azure portal. We have requirement that these Applications can be accessed only certain times in a week, those times are stored in the Azure Database. Is it possible to make the App Available/Accessible to the users upon looking at database
Here the Setting is that the application should be available only between 14:00 - 16:30 on TUESDAY. When I tried to research we can schedule tasks/workflows in the portal but couldnt find what I am looking for. All I wanted to know is this requirement possible, if so please share the idea.. I am new Web App development and Azure deployment, any help is greatly appreciated
This feature is not available in Azure out of the box. This is something you will have to handle yourself.
One obvious way to implement this would be to check if the application should be available on every request. If the request day and time falls between the available times set in the database, you show your users the website content otherwise show them some kind of not available message.
A more complicated way would be to make use of App_offline.htm file to make your site unavailable. You can dynamically add/delete App_offline.htm file to your WebApp based on the day/time when you want your site to be offline/online.
However please note that while your site is offline, you will still be charged for the WebApp as the resources keep remain provisioned.
You can use Azure Automation Service to orchestrate processes like this. You will have to create a runbook (script in python or powershell) that will query the DB and figure out the times when the Azure Website hosting your webapplication should be started or stopped.

Deploying the same site N times

With our company, we sell a service to our customers,
this is a website which let customers enter some parameters and informations, and then, they can query a web service to get
the previous informations computed. These web sites are hosted on our servers.
We would have on our servers one database per client (dbo.Client1, dbo.Client2...) with the same schema.
And we would like to provide a different url for each client :
expl :
www.client1.service.com www.client1.ws.com/compute
www.client2.service.com www.client2.ws.com/compute
But i'm wondering how to deploy easily the web services and the web site?
Do i have to deploy one web service and one website per client (with different web config)?
And maybe create multiple deployment scripts ?
Or is it possible to imagine one instance of each (web service and web site), listening on several addresses, and creating different
connection string according to the entry point of the request (is it even possible with MVC or WCF ?)
Any other idea ?
I don't know what is the best practice here.
Thank you.
if anybody read that question one day, i solve my problem using multi-tenant solution, which allow me to deploy only one instance of the site.
The site handle the webrequest, and according to the host, connect to different database.

ASP.NET MVC - Creating SAAS framework

I currently have a ASP.NET MVC 2 web application and would like to enhance the architecture to support a SAAS model. I plan on eventually building a number of web applications so would like to design the system accordingly.
The goal would be that when a client would hit the following url clientxyz.domain.com they would see an image of all their subscribed applications. This would essentially be a web page with a bunch of application icons. Once a client would click on a icon it would navigate to that actual web app at the following example url clientxyz.domain.com/application_name.
We currently use GoDaddy to host our domain and plan on using a Cloud based iLand server to host our application. We only plan on a few new clients a year due to the nature of our software.
I have a number of questions:
Is it possible to programmatically create subdomains on the fly using a .Net api. I'm pretty sure GoDaddy does not let you do it. So is there another provider that would let me create subdomains via C#. This may be the wrong approach and may not even need to physically create client subdomains. Instead I may be able to accomplish this using url rewriting in IIS/MVC?? If I use rewriting, it would have to satisfy the url requirements mentioned above. Any suggestions/links/examples?
Should I create a separate IIS website for each tenant/client? Or should I use URL rewriting and simply have a single website / application pool? Looks like you can programmatically spin up IIS websites (example: http://www.eggheadcafe.com/tutorials/csharp/d4bba585-b517-4834-8476-ff05b085d86e/iis--create-app-pools-virtual-directories-and-web-sites-c-net.aspx)
Since we are using a Virtual Server on iLand do I simply have to point GoDaddy to the nameserver at iLand.
I would like to automate the entire new client process if possible. To accomplish this, I would have to created the database (probably going to have single db per tenant), populate the global client/tenant table, create admin user account and subscription details in newly created database and create subdomain depending on approach. Am I missing anything?
thanks in advance.

Windows Azure + Asp.Net MVC + E-Commerce

I will developp and host an e-commerce website based on Asp.Net MVC4 (with several SQL Server Jobs).
I think use Azure in order to stay in Microsoft's world and avoid dedicated server management.
The package Web Site Shared with 1 site / 5Go SQL Server Database / 200Go Bandwidth is very interesting with the price based on 12 months.
But i don't know if this configuration is enough specially on the bandwidth.
What do you think of ? Did you use Azure with this type of application ?
Regards,
Guillaume.
If you want to develop E-Commerce application you will have to secure customers' sensitive data i.e. credit cards, address details etc. via secure connections (HTTPS; in many countries this is legal requirement). For that reason you will have to have SSL support.
Azure Website do not support SSL for custom domains. However, they support SSL for *.azurewebsites.net DNS name. So if your E-Commerce application DNS will be, say, my-ecom-app.azurewebsites.net then it's fine. Otherwise, I would not recommend Azure Website solution yet (I am sure SSL support for custom domains on Azure Website will be implemented).
Azure Cloud Services, on the other had, have full support of SSL for custom domains.
One of the really good websites to check Azure features and development roadmap is ScottGu's Blog
Azure Web Sites do not support SSL and I really don't know of any successful e-commerce site that does not run SSL for at least part of the website. If you really want to host your e-commerce on Azure today your only real choice is to run Virtual Machines for your web front end servers and use them for your DB or use SQL Azure.
We developed platform called Virto Commerce that does just that, MVC4 website hosted on Azure. There was also a need for SQL Jobs (indexing, payment processing, cart cleanups and so on) for which we used WorkerRole (instead of WebRole). WorkerRole and WebRole can actually be combined as part of a single deployment, however it is better to use a different instance for worker roles. In our case WorkerRole acted as a scheduler for multiple jobs defined in the database.
The challenge with WorkerRoles however is to make sure they scale well when new instances are added. So the workload needs to be distributed between multiple instances. This is done through the use of queues and blob locks, where each job is now split into two, one that schedules and partitions the work and the second that actually picks up the next partition and completes it.
Hope this helps!
PS: Virto Commerce is now available as an open source project on codeplex, go to http://virtocommerce.codeplex.com

SharePoint User swipe

I have a SharePoint site developed in MOSS 2007. My site is using SharePOint farm architecture which includes following servers in it
One Application server APP1
Two Database Server's mirrored (DB1,DB2)
Two Front End Server's (WFE1, WFE2)**
Recently we are receiving complaints from customer saying that when A user logging with his credentails and navigate to site, sub-sites in it. When he click on Home (Root site) Tab he certainly loose his active looged in session and he see the home page for another user with his access previllages.
Can some one tell me what is the root cause for this...?
Any help will be highly appriciated.
FYI: I have implemented caching to improve the performance of this site.
Thanks & Regards,
Sachin k
It seems to be the problem with setting of Load Balancer. Special care needs to be taken when SharePoint is load balanced under kerberos.
See:
http://sharepointspot.blogspot.com/2007/09/kerberos-load-balanced-web-sites.html
http://blogs.msdn.com/b/joelo/archive/2007/01/05/nlb-network-load-balancing-and-sharepoint-troubleshooting-and-configuration-tips.aspx
Specifically:
To manage session transfer:
Use ASP.NET SQL Session management so all sessions are recorded in a central location OR
Use affinity on the switch so that concurrent requests from a particular IP address within the same session go to the same target server

Resources