This is a migrated thread and some comments may be shown as answers.

IIS hanging, CPU usage through the roof!

3 Answers 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Duncan
Top achievements
Rank 2
Duncan asked on 01 Dec 2011, 11:12 PM
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

3 Answers, 1 is accepted

Sort by
0
Duncan
Top achievements
Rank 2
answered on 03 Dec 2011, 01:54 AM
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...

 
0
Dimitar Kapitanov
Telerik team
answered on 05 Dec 2011, 08:45 AM
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!

0
Duncan
Top achievements
Rank 2
answered on 05 Dec 2011, 05:05 PM
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.
Tags
General Discussions
Asked by
Duncan
Top achievements
Rank 2
Answers by
Duncan
Top achievements
Rank 2
Dimitar Kapitanov
Telerik team
Share this question
or