Search code examples
windowsasp.net-mvc-4iis-7.5windows-server-2012

ASP.NET MVC sites running very slow on LAN but works fine localhost


For over a year now I have been developing an "intranet" site for somebody that they use do to various daily tasks.

It is MVC 4, pre compiled views, IIS 7.5 running on Server 2012 i7 16GB RAM.

All of a sudden yesterday all the LAN machines, using Chrome or IE, page laoding take between 25-55 seconds! Even static pages. I log on the server, zoom zoom, no problem? 1013ms.

I installed Glimpse and published, then on a LAN machine and it the break down is

  • Request 32000ms, wire 55ms ..
  • View 12ms,10ms,various partials,..... the last one 25 seconds.
  • Ajax running on site is 12ms-15ms response and Glimpse updates fine.
  • The glimpse AXD settings page loads quick too.

I deliberately loaded a page where there are about 50 partials that hit the DB 50 times. These partials are as expected. 12-15ms per render. But the last render is 25 seconds?? Then loaded a pretty static page. No partials but the same end results. (not DB then, right? It wouldn't matter because IIS does DB requests on the local machine anyway and I know local is working perfectly)

I checked in chrome networking. The 55 seconds wait, is not DNS(or atleast it says its not) Its just labeled as waiting. Then the transfer is like 200ms all the rest of the files cahced. So I clear cache, the initial 25-55seconds again, and then all the JS, CSS downloads rapidly within 500ms.

So its not a network issue, as in faulty or dodgy wires. Its perfect Gigabit full speed throughput.

I have not published anything for the week. I restarted all routers and switches, all computers and server.

  • The server acts as a domain but clients are home premium, not connected to the domain.
  • Because of this DNS is set to the Internet gateway and setting DNS to the server causes internet problem, so I jsut adde a hosts "webbapp 192.168.1.1" (worked for over 12 months)
  • I use the WebMatrix membership for forms authentication, so that is once connection string to the MainDB.
  • The daily routines are stored in the MainDB using the connection string but a different name for Linq2SQL.
  • Then there are 5 other DB's that are used to search for records and only get hit from a Search page.
  • I logged into SQL Manager as the user. Its quick. I checked the DB files for main it was 2.2GB so I purged the log file and its 330mb now. Its quicker on local but still no change for LAN machines.
  • I recycled the app pool. I made sure timeout is set higher than 1 mintue, its 90 minutes
  • Its not set as a webfarm, the user identity is the default. I tried the local admin. No change.
  • I created a new app pool, changed it over to there. No change for LAN machines.
  • I republished the site, maybe some corruption? Nope. The same.
  • web.config is set to debug=false
  • I removed optimizations, that was a recent change I made. SO i just dumped all CSS,JS the files as they were before. That didn't change anything to.

I kept an eye resource manager. Not even a dent in the processor (its idle, there is nothing else running or blocking). HDD a few hundred kb in transfer. RAM is ample.

I checked the request being made to the server, who know maybe something is doing more than 1000 request a seconds DDoS the machine? Virus or something. Nope.

  • No requests on anything happening on IIS. So not DDoS.
  • Log files from IIS look fine. No errors
  • Eventviewer, no errors.
  • Enabled tracing in IIS. Nothing happening.
  • Restarted SQL Server separately
  • Disabled AV

This problem affected ALL the machines at the same time (12/11/2014) (newer ones, older ones, notebooks). So I can only suspect an Windows Update? Chrome Update?

Anybody having the same day of hell as me? I don't know what else to check.


Solution

  • Spent over 10 hours trying to fix this. First time using xperf and was really good experience but could not identify the problem.

    This morning everything works fine and I did not do any changes at all.

    I suspect a networking error. A switch I forgot about maybe that when haywire as it affected all PC's on the LAN at the same time and then resolved all at the same time.