Con risposta Worker Role at 100% and code not executing

  • venerdì 27 luglio 2012 13:30
     
     

    Hello, I have developed a worker role with the latest SDK (1.7) and deployed it. The role has logging turned on which is scheduled to be transferred to Azure Storage every minute. The Worker Role works as expected on the local emulator and transfers the logs to the local azure storage. When deployed the CPU stays at 100% with WaWorkerHost.exe being the process to blame (98-99% CPU utilization). The tasks that are supposed to be done by the worker role are not being performed and the logs are not being transferred to Azure Storage (yes, I changed the Connection String to point to the right Storage).

    Under C:\Logs the WaAppAgent file has this logged many times over and over again every 3 seconds.

    [00000011] [07/26/2012 09:32:48.45] WaAppAgent Heartbeat.
    [00000011] [07/26/2012 09:32:48.45] Role 5719b23b4a5f4a2fbb065ced70a71c6c.Agent_IN_0 is reporting state Ready.
    [00000012] [07/26/2012 09:32:51.70] Role 5719b23b4a5f4a2fbb065ced70a71c6c.Agent_IN_0 has current state Started, desired state Started, and goal state execution status StartSucceeded.

    The AppAgentRunTime concludes with:

    [00001744:00000248, 2012/07/27, 13:03:19.867, 00100000] Finished waiting for LB ping. Proceeding to start the role.
    [00001744:00000248, 2012/07/27, 13:03:19.883, 00040000] State of 5719b23b4a5f4a2fbb065ced70a71c6c.Agent_IN_0 changed from 15 to 3.

    The Windows Azure Event Log has:

    Role is starting. Process ID: 2376, Process Name: WaWorkerHost Role is starting: OnStart()
    Role started. Process ID: 2376, Process Name: WaWorkerHost Role start finished: OnStart()
    Role is running. Process ID: 2376, Process Name: WaWorkerHost Role is running: OnRun()

    Which tells me that the Worker Role starts and runs.

    Is it normal for the CPU to be at 100%? What else can I do to find the problem?

    Thanks,

Tutte le risposte

  • lunedì 30 luglio 2012 06:24
    Moderatore
     
     

    Hi,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay.
     
    Appreciate your patience.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

  • lunedì 30 luglio 2012 10:47
     
     

    Quick question, is your worker role has any code like below

    while(true)

    {

     do some job

    }

    The true condition stays like that till we stop the worker role explicitely. If you have code something like that it is going to keep your CPU always high due to the resource intensive loop.

    If it is not the problem. Why dont you just deploy your worker role without logging and diagnostics and see if it is really the problem with logging.



    Please mark the replies as Answered if they help and Vote if you found them helpful.

  • lunedì 30 luglio 2012 12:58
     
     
    yes, I do have the while loop with a Thread.Sleep(5000); I'm OK with that using 100% of the CPU, but why wouldn't my code execute? I'm using Quartz.net for executing jobs and none of them seem to be called. Like I said before, everything works perfectly on the emulator.
  • lunedì 30 luglio 2012 16:35
     
     
    ok fine as long as you have pause on the thread, it should not shoot up the CPU usage. Can you post your code and configs if possible to see if any issue is there with them first.


    Please mark the replies as Answered if they help and Vote if you found them helpful.

  • lunedì 30 luglio 2012 22:57
     
     Con risposta
    I have decided to delete the production deployment and re create it and it is now working perfectly!