IIS hanging, CPU usage through the roof!

4 posts, 0 answers
  1. Duncan
    Duncan avatar
    93 posts
    Member since:
    Jul 2012

    Posted 01 Dec 2011 Link to this post

    Has anyone experiences IIS hanging (for lack of a better word) and CPU usage maxes out on all 4 processors. I am able to stop debugging and run my application again, but it is almost as if there is a thread in a endless loop that is out of control continuing to run in the background.

    I am able to reproduce the issue by rapidly clicking to reload the page and its data, eventually something happens and it hangs IIS. Stopping the debugger does not help the issue either, the CPU usage still remains high and continues to climb even though i am doing nothing as if there is a background thread still running.

    My application does not implement any custom threading. If there is a thread with a issue it is not one that i have started. The code in question is pretty simple stuff, there are no large database calls and no calls to the db within any loops that might hang. In order for me to get my processors back i have to either restart my machine or restart the World Wide Web Publishing Service, once this is done the CPU usage drop back down to 0%.

    Reproducing the issue is sporadic, no errors are being caught in any of my error logging. I have gone through a process of elimination and the issue only seem to occur (at least more frequently) when i enable some of my custom user controls that calls methods in my DAL. E.g. this one:

    public IList<CampaignDTO> getCampaigns(string email)
    {
        IList<CampaignDTO> outobj = new List<CampaignDTO>();
     
        using (BluefireDBContext dbContext = new BluefireDBContext())
        {
            Users user = dbContext.Users.Single(u => u.Credentials.Email == email);
            IList<Campaigns> campaigns = dbContext.Campaigns.Where(c => c.UserGroupID == user.UserGroupID).ToList();
     
            foreach (Campaigns campaign in campaigns)
            {
                CampaignDTO newdto = new CampaignDTO();
                newdto.CampaignID = campaign.CampaignID;
                newdto.ReferrerID = campaign.ReferrerID;
                newdto.CampaignName = campaign.CampaignName;
                newdto.UserGroupID = campaign.UserGroupID.Value;
                newdto.Active = Convert.ToBoolean(campaign.Active.Value);
     
                outobj.Add(newdto);
            }
        }
     
        return outobj;
    }

    As you can see, nothign out of the norm. This method is like all the other DAL methods i have. I do not think that it is this method or code in particular but rather the ORM and the fact that i am rapidly calling for data.

    Is there anything that would cause the ORM to get hung up? Has anyone seen or experienced this before? And is there anything additional i can do to debug this?

    Thanks,
    Duncan
  2. Duncan
    Duncan avatar
    93 posts
    Member since:
    Jul 2012

    Posted 02 Dec 2011 Link to this post

    Sorry guys, this ended up not having anything to do with OpenAccess. Rather it was a highly annoying and illusive loop that became infinite in only certain scenarios...

     
  3. DevCraft banner
  4. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 05 Dec 2011 Link to this post

    Hello Duncan,
    Even that it is not related to OpenAccess ORM, please do share some insight with us if the cause was settings of the IIS or some usage not really trivial (I mean if it was not cause by application code itself).

    Kind regards,
    Dimitar Kapitanov
    the Telerik team

    Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

  5. Duncan
    Duncan avatar
    93 posts
    Member since:
    Jul 2012

    Posted 05 Dec 2011 Link to this post

    No it was code related and very trivial. I had a unique random number generator that was looping out of control. Not IIS related, not OpenAccess related.
Back to Top