2

I have a wcf service hosted on azure. When I deploy it and start the autoscaler object the web service roles are constantly being recycled and in an unhealthy state. If I do not start the autoscaler I have no issues, however I would like to use WASABi.

Here is my WebRole.cs

ublic class WebRole : RoleEntryPoint
{
    private Autoscaler autoscaler;
    public override bool OnStart()
    {

        // To enable the AzureLocalStorageTraceListner, uncomment relevent section in the web.config  
        DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
        diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
        diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());

        // For information on handling configuration changes
        // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

            autoscaler = EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>();
            autoscaler.Start();


        return base.OnStart();
    }

    public override void OnStop()
    {
        autoscaler.Stop();
    }
}
Alex McClary
  • 107
  • 1
  • 11

2 Answers2

0

Have you tried using IntelliTrace to diagnose the reason for recycling? Here is a good article descirbing how to setup and trouble shoot with IntelliTrace.

Petar Vučetin
  • 3,555
  • 2
  • 22
  • 31
  • I cannot use Publish because I am behind a company proxy. Also I've tried putting the autoscaler in a worker role instead and the same problem occurs. I believe the Autoscaler has a serious bug. – Alex McClary Nov 08 '12 at 21:42
  • 1
    I was using version 1.4 of the sdk rather than 1.6. – Alex McClary Nov 27 '12 at 16:44
0

What does your Run method look like? It needs to keep the role alive so it should be something like this:

    public override void Run()
    {         
        Trace.TraceInformation("ScalerRole entry point called", "Information");

        while (true)
        {
            Thread.Sleep(100000);
            Trace.TraceInformation("Working", "Information");
        }
    }
Dave Bending
  • 171
  • 1
  • 7