Azure alwaysOn is not loading MEAN app on server restart - angularjs

I have a MEAN stack application hosted on Azure with the alwaysOn setting, but this doesn't seem to start the node process without a manual http call.
This is fine but not ideal for front end tasks but killer for a daily task that needs to be executed.
Has anyone encountered this and are there any solutions?
AlwaysOn configuration or something?

alwayson would hit your webapp every few minutes. what do you mean by it doesn't load actual app ?
check if your node.exe process is active in process explorer at kudu console.
kudu console : http://yourwebapp_name.scm.azurewebsites.net/DebugConsole

Related

"The underlying provider failed on Open" when running under IIS

We have a website running on a server. We have a "production" instance and a "staging" instance each having its own database. The MSSQL Server is running locally on the same server.
Today, suddenly the "production" website went down. Looking at the logs, the following exception showed up:
System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
At the same time, the "staging" website was working just normally.
While trying to figure out what was happening, I tried all sorts of things like re-creating both the app pool and the IIS app. I also hooked up the "production" IIS app to the same app pool of the "staging" app, still the same issue. Restarted the server too of course.
Also, I ran the executable of the "production" website directly (as a console app) and it worked normally. So it's a problem that happens only when running under IIS.
One last thing I tried, is that I reconfigured the "staging" website to use the "production" database, and to my utter shock it worked normally. Because I thought the problem was the "production" database itself.
I just have no idea whatsoever about what's going on here. Any help is very much appreciated.
If all the connections in the connection pool are used, it is almost certainly because your application is opening database connections and failing to close them.
Since you are using Entity Framework, it's probably because your application is failing to dispose of the DbContext object.
It's nothing to do with the production database as such; probably the increased activity on your production site vs your staging site is making the application bug manifest itself more quickly.

No response from server when calling stored procedure in entity framework remotely

I have a Silverlight web app being hosted on Azure vm on IIS. I have another VM that is hosting SQL Server along with other application that the web app interacts with. I have set up a LAN between these two VMs using Azure Virtual Network. The vm that is running IIS and hosting web app is also my domain controller and I am using windows authentication to authenticate users in this web app. The application makes use of entity framework to execute some stored procedures.
Overall everything seem to work fine when the web app is accessed both locally and remotely, but there is one particular stored procedure that takes around 25 minutes to execute that does not seem to behave properly when executed remotely via this web app. Please keep in mind that this 25 mins is actually the expected time because this stored procedure is dealing with millions of records.
So here is the problem I am having. When this stored procedure is executed from SQL Server Management Studio, it completes in around 25 minutes. When I execute this stored procedure from the web app locally by making use of the internal ip of the server that is hosting the app, it competes in around 25 mins, the server sends the response back and the app updates its status. But when I execute via web app remotely using server's public ip, although the stored procedure executes and completes within 25 mins on the server, the app never gets response back from the server, keeps staying on busy status.
I know the stored procedure executes because I am tracking it in the database server directly and also using sql profiler to track any open connections from entity framework, which is there even after the stored procedure completes execution.
I am also using fiddler to track all HTTP traffics and here is what I see.
While executing locally via web app using internal ip
while executing remotely via web app using public ip
All other stored procedures take few seconds to execute and they seem to work both locally and remotely. I am not sure if Azure's endpoint mapping has anything to do with this. When executing this stored procedure I set commandtimeout property to 0.
Any help would be very appreciated!
image links:
local execution: http://i.imgur.com/NGNre3T.png
remote execution: http://i.imgur.com/haB3fwm.png
This could be an idle timeout by the Azure load balancer. Have a look over this page to see if it sheds any light on the problem. Using the latest version of Azure Powershell, you can check the current timeout setting with:
Get-AzureVM –ServiceName “your-service-name” –Name “your-vm-name” | Get-AzureEndpoint
Depending on your setup, you might be able to set this up using:
Set-AzurePublicIP –PublicIPName "the-ip-name" –VM “your-vm-name” -IdleTimeoutInMinutes 15

gae cloud sql active connections not closing (keeping the instance running)

I stopped all the instance Running in my app but still Cloud SQL have a one Active connection, I have no idea why.. is that keeping the Cloud Sql Instance running.. and I'm getting charged for the hours it used.. please help
There are a few places that a flag could be set to keep the Cloud SQL instance alive.
Go to the Dev Console Your Project -> Cloud SQL -> SQL Instance -> Edit -> "Show advanced options..." -> ACTIVATION POLICY make sure its set to "On Demand".
if you are still seeing it up then:
Go here and fill out the information. Under fields select only 'settings' click execute and scroll down. Look for 'activationPolicy' and see whats set to. You can use the API browser to change the setting or gcloud

Tomcat 6.0 is getting stopped after certain time automatically

Tomcat 6.0 is getting stoped after certain time automatically.. My machine is never turned off. but still this process is stopped . I am using My tomcat server in production mode.. and I really don't feel good starting my server daily.
What could be the reason because in Production mode server should never get stopped.
Check in your task scheduler;
Go To start->type in search task schduler
go to task scheduler. Check whether any task is running to stop the serverr.
or you can increase permgen space.
Server might be stop because of out of memory exception.

ActiveDirectory Provider fail over Best Practices

ActiveDirectory Server 2003
I am using the ActiveDirectoryMembershipProvider and ADroleProvider. They work great. Until my active directory server restarts in the middle of the day to get updates. (I'm not in charge of the server and can't change this). When this happens, for the five minutes the server is rebooting, my users can't use my website because I've tied my menu to the Role Provider. So, here are my questions:
Is it possible to tell my RoleProvider to use the "next" available ADS? If so, how so that while the initial one reboots, I don't frustrate my users with ADS connection messages?
Should I be using some kind of connection pool that automatically reconnects to the available server? If so, how?
Let's imagine that all my active directory servers go down. Is there a way to keep my web application running? Obviously there are bigger problems if all servers are down, but what I'm after is a possible "disconnected" active directory authentication that will still move forward if the server somehow goes kaput. Is this wise AND possible?
You probably have the server connection string set to "server01.domain.local". If you change it to just "domain.local" you're no longer depending on "server01" being online. Instead you will use the Round Robin feature of Active Directory DNS to get a list of all domain controllers and use one that's online. (I don't think your admins reboot all of the domain controllers at the same time...)
Also try running nslookup domain.local a couple of times in succession in a command prompt to see the order changing.

Resources