How do you setup a load balanced environment with ASP.Net 5 (vNext) while using the DNX environment? - asp.net-core

Description
I am curious about how a DNX load balanced setup will work. I am accustomed to working with an ARR (Application Request Routing)/Server Farm setup with IIS like this. Typically there is nothing done on the code side with the ARR/Server Farm setup. However, with the cross platform support that DNX provides, while getting rid of IIS, this sort of load balanced setup seems like it will now need to be handled in the code. Or at least in my case I would be responsible for code deploys as opposed to a Network Admin that would install updates. The closest that I could find is session management. Can you do load balancing with this, potentially, I just do not see it there yet.
Functional Impact
Decide to download a third party ARR, use MS ARR, or Role your own ARR?
What I need
I would like to keep this from "I like this best" responses as much as possible and see responses that are "Here is why you need this" or "Here is why I found this to work well". I know that dnx is a new environment, but the experience of setting up LB servers in OSX and Linux is not. With the move to cross platform, I do not expect that the MS ARR will work on OSX or Linux. I am not very familiar with those OS's so I do not know where to begin.
Question(s)
1) Is the https://github.com/aspnet/Session/ project (or another project) expected to contain an ARR?
If no on 1
2) Is there an ARR that is cross platform (Windows, OSX, Linux)?

There's no out-of-the-box load balancer for ASP.NET 5.
Your solution is the right one, add a load balancer in front of DNX. On Windows you can use IIS, on cross plat you can use something like ngnix

No changes and no support for in-app.
ASP.NET 5 is not where this should be going. IIS will still exist and the ARR module is a part of IIS itself. Not the app.
On the page itself it says:
Works With: IIS 7, IIS 7.5, IIS 8, IIS 8.5, IIS 10
As for supporting different kind of servers? I don't see why not since the ARR module is basically just a reverse-proxy.
Nothing need to change. You can even compile to CoreCLR and have it hosted on a farm of Linux machines with Apache but have an IIS server with the ARR Module set in Reverse-Proxy to forward load balance the requests.

Related

Understanding ASP.NET Core with Apache

In IIS we had an aspnet_isapi extension that handles the request, it then spawns a process w3wp.exe, w3wp.exe then loads and starts the CLR and then CLR does its job.
Now, Kestrel is configured inside the Main() method, so first the Main() should execute, so who starts the Core CLR ? is it IIS for windows and Apache for Linux? Do IIS and Apache know how to search and start Core CLR?
What I know is, when a .NET application is executed at that time the control will go to the operating system, the OS creates a process to load CLR.
The program used by the operating system for loading CLR is called runtime host, which are different depending upon the type of application that is desktop or web-based application i.e.
The runtime host for desktop applications is an API function called CorbinToRuntime.
The runtime host for web-based applications is the ASP.NET worker process (aspnet-wp.exe).
So, how is it possible that first the Main() method will execute and then the CLR, i am not able to digest it, please help.
Forget about everything you know about IIS.
For Apache or nginx, just run your ASP.NET Core console application (who initializes Core CLR) at a local port (http://localhost:5000 for example), and then set up reverse proxy rules to forward external traffic to that port.
That's roughly what Microsoft documented in this article
Such reverse proxy setup is common, as other web stacks (Node.js, Python, Go) are using the same approach.
Because of this specific setup, Linux launches your .NET Core console app by analyzing the COFF envelope (of dotnet executable, or your own executable for self contained deployment) to locate the native entry (not your managed Main).
Apache/nginx is not involved in anyway.
Calling into this entry triggers CoreCLR initialization, and in turn your managed assemblies are loaded and managed Main is called.
You might find articles like this helpful.

Web server to host Sencha app?

I am looking to develop some web app for my Android device. Found Sencha and think it might be a good tool to try out.
I suppose I would need to find a web server to host the Sencha app to run the app? What kind of web server is needed? I suppose one that able to run HTML5, CSS, Javascript is enough?
Can anybody recommend one (free one)?
Thanks.
++++++++++++
Thanks for the answers to the above post. I am new to this stuff, so got some more follow-up and somewhat related questions:
1) I read from the Sencha site that the app can be developed locally using things like XAMPP installed on local Windows PC. Question -- Why need this local host when I can just use an external Web Host?
2) It was also mentioned that for Windows may not need XAMPP if Window's Internet Information Server (IIS) is already running. How do I know if my computer is running this and so don't need to install another local server? (I asking this because I had installed an XAMPP before on another computer and things got quite messed up and so I want to avoid doing it if possible).
3) Once I got a web host, to have an app running, I would just have to have the JS files in the web host together with the Sencha framework right? If so, then I don't understand what is meant by "Build" in the Sencha documentation.
Thanks.
Sencha Touch is a client side framework, therefore there are no server side requirements. That said, any web host should do.
However, I'll go ahead an make a recommendation... a LAMP stack (Linux, Apache, PHP, MySql) will work the best. Of course you can substitute any of the stack for something of your favor, this setup seems to be the most favorable. Some of my colleagues utilize Ruby/RoR instead of PHP, so as you can see it is quite flexible in terms of environment.
When searching for a hosting provider, do your research and select something that fits with your budget but still gives you the best bang for your buck. Be sure to ask them questions!
Tip: Make sure you have access to your web server's configuration file so you can add mime_types and make other mobile oriented tweaks if needed.
First you must know that HTML5, CSS and Javascript are all front end stuff that do not count when you talk about Hosting. These are taken care of by the client agent (browser).
What really matters is your server side language: PHP, Python(Django), Ruby, etc.
So it mainly doesn't matter which framework, as much as which language that framework use.
This is a generic answer that will help you decide not only in terms of Sencha but for any other framework.
Take for instance WordPress. It uses PHP and MySQL, so first I look if my Web host supports Mysql and PHP and in general this would be enough to know that I can use if for my WordPress site.
And by the way, most Web host companies allow you to ask them questions before buying. So go ahead and question them about anything that concerns your requests.
Sencha provides an app hosting service through its Sencha.io cloud services.

AppFabric for WCF services on Windows Server 2008 R2

we are currently on windows server 2008 R2, IIS 7.5 and we are going to open some of our data via WCF services.
To do that, we are planing to host our services on IIS but I heard that it is not a good idea for WCF services.
The problem with the WAS is that it is general purpose hosting engine. it's actually unaware that it's actually hosting a WCF service or a website (as far as I know)
I heard that we can install an extension to the WAS called the Windows Server AppFabric.
does anybody have any experience on
AppFabric?
should my app have to use so called
'Service Bus' to use AppFabric?
should I go ahead and definitely
install it?
at most basic level, how and where
can I install it? does it require
any licence?
Thanks in advance.
I don't think IIS us a bad idea - many developers use IIS to host their WCF services. IMHO you'd only use what you need, so if all you need is a hosting framework, then IIS is a very good option for WCF services. It is (almost) unaware that it's hosting a WCF service, but that in the majority of the cases isn't an issue.
Windows Server AppFabric as it's currently released provides three capabilities: a distributed caching system (so if you need to scale out your service you can use this cache to share state among the nodes); a packaging / deployment interface (in which you can package a project and deploy it a little easier in IIS); and a management / monitoring interface (where you can monitor the instances of WCF and Workflow services which are running in your machine).
Answers to your questions:
Yes, some people have experience with it :)
No, the application doesn't have to use it. You'd only use the ServiceBus if you need its functionality (relay)
Only if you need it. If you don't need caching or the monitoring capabilities, for example, then I'd say you don't need it. I've found in the past that the least number of components I have in my system, the less likely it is to break.
Go to http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx. And AFAIK you don't need any license, but you can check on the download page to see if it has more information.
There is no real common reason why not to host a service in IIS/WAS.
If you want to absolutely, totally 100% make sure that your service is continuously running some process, such as a continuous loop or polling monitor, and if any interruption no matter how brief is a major issue, then you'd want to look at alternative hosts.
Win Server AppFabric is most useful for WF Service hosting and caching. Note however that Win Server AppFabric + Win Server Service Bus 1.0 represents the first steps in convergence between the Azure platform and the Windows Server private platform.... In other words, whichever of the two ways you choose, that's what is going to be earning your bread and butter in 5 years time.

Out Of Browser Silverlight app with local offline database and WCF-RIA

I have the following scenario:
We develop a silverlight 4 app for our customers, that will be used as an out-of-browser app. The app is working offline, i.e. app and database are on the users local machine. The app is using WCF-RIA-services to connect to the local database. The database will be an SQL Server Express, SQL Server CE or MySQL. We are using MVVMLight and MEF.
An external webserver is only used for updating the app from time to time or adding new modules to the app. To achieve this we do something similar as shown in Jeremy Likness blog (http://www.wintellect.com/CS/blogs/jlikness/archive/2010/05/25/silverlight-out-of-browser-dynamic-modules-in-offline-mode.aspx )
The reasons why we are doing such a scenario are complex. But to keep a long story short it is mainly for compatibility reasons for a later online version and we don't want to use WPF. So we need to get this working with Silverlight and WCF-RIA services.
Ok, that's the scenario and here's the question:
Do we need a local webserver in this scenario? The app is programmatically installed as out-of-browser, the database is local and connected via WCF-RIA.
If yes, which webserver would be sufficient? It should be installed and configured via an initial setup that is executed by the customer. The customer should not have to do anything with configuring the webserver.
Any other ideas or comments on this scenario? Any other possible solutions for this?
Thanks for your help
Dirk
silverlight wasn't meant to be used this way I think. So it would be like when you are developing app in visual studio and use Cassini to see result - everything runs locally - but you still need a web server. Maybe more info here - http://www.infoq.com/news/2010/06/WPF-vs-Silverlight
I´m not able to provide with a full answer to your problem, as we are currently facing the same problem. (WPF not being cross-platform, Very specific hardware on some clients)
But I may share some of our thoughts on our type of Thick-Silverlight-Client:
To keep deployment etc. simple we use a self-hosting process (installed as background process)
We may not use RIA as the background process has to run using Mono VM (but for MS-only solution see Can WCF RIA Services be self hosted? )
Architectural thoughts on standalone "Clients":
Depending on your requirements implementing a server for each client communicating with the "main"-server by messages (NServiceBus) may be overkill. But if you want to use a client database if offline and silverlight for ui you should consider using an event-driven-architecture.
There is a slideshow on combining "Event-Driven-Architecture" & "CQRS" with Silverlight. But i would not use it as a blueprint more like an inspiration.
http://www.slideshare.net/dennisdoomen/cqrs-and-event-sourcing-an-alternative-architecture-for-ddd

Why use Glassfish instead of Apache? What's it strengths and weaknesses?

Sorry for my ignorance here, but when I hear the word webserver, I immediately imagine Apache, although I know people use Microsoft's IIS too. However since I've been hanging out here at Stackoverflow I've noticed lots of people use Glassfish.
Which made me wonder, why would I want to use Glassfish (in the sense that I'm interested, but I don't really understand why it might make my life easier). From what I read it's Sun's open-source derivate of Apache's Tomcat, thus I imagine it's a good (or great) quality product. But since I don't know its strengths and weaknesses, I don't know when it would be wise to choose Glassfish over another server. Could anyone elaborate ?
GlassFish is an Application Server which can also be used as a Web Server (Http Server).
A web Server means: Handling HTTP requests (usually from browsers).
A Servlet Container (e.g. Tomcat) means: It can handle servlets & JSP.
An Application Server (e.g. GlassFish) means: It can manage Java EE applications (usually both servlet/JSP and EJBs).
You should use GlassFish for Java EE enterprise applications.
The need for a seperate Web server is mostly needed in a production environment. You would normally find a Application server to be suffice most of your development needs. A web server is capable of holding larger number of active sessions and connections, thus providing the necessary balance without performance costs.
Stick to a simple web server if you are only working with servlets/jsps. It is also to be noted that in a netbeans environment, glassfish has better support than other App servers. In the context of eclipse though, WSAD and JBoss seem to the preferred options.
Glassfish will soon release the modular kernel.
This means that the containers you need start up and shutdown as you need them. I.e no EAR deployed, EJB container won;t start up. This seems to have made it very good for development as it can start and stop very quickly. This takes it a lot closer to development environments like Rails (where redeployment is a massive part of your development)
I have used GlassFish server for developing Web Services.
It provides a very interactive Admin Console where admin can test the Web Services.
I really find it helpful while developing Web Services