On the local PC, IIS and browser maximize the processor with a large set of results

I just upgraded to VS 2013, and also started a new MVC project, and I encountered 99% of CPU usage for several minutes of IIS while debugging on my local PC. (Occurs both in Release mode and in debug mode) I just realized that the problem is proportional to the number of rows returned by Linq Query. If I use Take (1) or Take (10), that’s good. If I use Take (100), a problem arises.

Here is my actionresult (with changed personal information):

public ActionResult Summary(string daystoshow, DateTime? day = null) { int daysToShow = daystoshow.ToSafeInt(); if (daysToShow < 1) daysToShow = 2; if (day == null) day = Convert.ToDateTime("4/14/2014"); SummaryViewModel m = new SummaryViewModel(); string warnings = ""; var ef1 = new carshowEntities(); DateTime dayAtMidnight = Convert.ToDateTime(((DateTime)day).AddDays(daysToShow).ToShortDateString()); var diplayItems = (from x in ef1.islands join y in ef1.cars on x.serid equals y.serid where x.dt==12 join z in ef1.ITEMS on y.serviceno equals z.ITEMNO join x2 in ef1.islands on x.serid equals x2.serid where x2.dt==8 join i in ef1.INVOICES on x.carStyle equals i.carStyle where i.STATUS==8 where x.LiscenceDate > day && x.LiscenceDate < dayAtMidnight orderby x.LiscenceDate, y.serviceno, x.serid select new ReturnedItem() { CarOrderDate = (DateTime)x.LiscenceDate, serial = x.serid, ItemCode = y.serviceno, Description = z.Color, DateSold = (DateTime)x2.LiscenceDate, ID = i.IX_ID }).Take(100).ToList(); m.daystoshow = daysToShow; m.day = day; m.diplayItems = diplayItems; m.warnings = warnings; return View(m); } 

I have not found other posts describing the exact circumstances here.

1) When the site is published, it works fine with the server.

2) When starting my MVC project in debug mode, the processor load reaches 99%.

3) The problem does not occur if I published locally.

4) This happens both in IIS and in IIS Express when starting from VS in Debug or Release mode.

5) This does not happen with other sites, only this project is still.

6) This is a simple project, one result of action and one page with a 200-row table populated with a Linq query.

Is there a way for the debugger to at least show me what it does?

EDIT:

With further research, I notice that if I wait 2 minutes, the processor will return from IIS, but THEN the web browser (Firefox or Chrome) will take 99% of the CPU for another 2 minutes.

+4
source share
1 answer

I found that the solution was to simply disable β€œ Browser Link ”, which was a new feature in VS 2013, after a lot of debugging and searching,

You can turn off the browser link on the toolbar by clicking on the down arrow icon, which looks like an update button.

The link to the browser is a way of making changes to the page in the browser itself, which seems to be working intensively in the CPU, so executing a large number of elements will cause the processor to splash.

+11
source

Source: https://habr.com/ru/post/979845/


All Articles