page processed in 1s, browser receives data after 21s [Answered]RSS

4 replies

Last post Sep 27, 2013 06:11 AM by JendaPerl

  • page processed in 1s, browser receives data after 21s

    Sep 25, 2013 05:26 PM|JendaPerl|LINK

    We have an ASP.Net MVC application that lately started to lag. I added some logging and even when the server gets slow, the page gets processed (start of BeginRequest to end of EndRequest) in about one second, but after that it still takes 20-40 seconds to send the data to the browser.

    Usually, but not always after the first slow request, the following ones sent by the same browser are quick. And a few minutes later it gets slow again.

    The application pool is not being recycled and there are other requests comming at the same time so the application is still warm, besides if that was the case, then the wait would be before the BeginRequest and the processing would be slow, but the problem is at the end of the processing. The data is all ready, but it's not being delivered.

    IIS/6.0 on Windows Server 2003R2, ASP.Net MVC 2, .Net 4.0, wildcard application map: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

    There's plenty of space on the harddrive, the web runs at around 10% CPU utilization most of the time including when it lags.

    Any ideas?

    --------------------------------------------------
    http://jendaperl.blogspot.com
  • Re: page processed in 1s, browser receives data after 21s

    Sep 25, 2013 11:26 PM|lextm|LINK

    You will have to dive deeper to see which part on the wire eats up the time and based on what you said I don't think IIS is the culprit.

    Is it possible that you capture network packets on both the browser and IIS sides so as to measure the network latency? That should give you some hints. Also in IIS log files you can see the total time consumed on IIS side. Without more data at hand, you can better understand the time distribution and determine the bottleneck.

     

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: page processed in 1s, browser receives data after 21s

    Sep 26, 2013 06:32 AM|JendaPerl|LINK

    I'd like to dive deeper, but don't know where and how. I tried to

    telnet the.web.site 80
    GET / HTTP/1.0
    Host: the.web.site

    To make sure the browser doesn't play some dirty tricks with the conections and stuff and even this way the lag was there. Also it's not just me seeig those lags, so I don't think it's anything on the client. Though the truth is that even static files exhibit this behaviour.

    The rows in the IIS logs do include those strange 20-40 seconds.

    --------------------------------------------------
    http://jendaperl.blogspot.com
  • Rovastar Rovastar

    5486 Posts

    MVP

    Moderator

    Re: page processed in 1s, browser receives data after 21s

    Sep 26, 2013 10:15 AM|Rovastar|LINK

    Just to clarify the IISlogs that Lex mention. The time-taken also includes any network/transmission time.

    You could use things like Fiddler on you local machine to get a better breakdown.

    But really as Lex said you nee packet sniffer tools (like Wireshark or Netmon) to analyse this further.

    You also need to know what network infrastructure (Firewall, routers, proxies, etc) is involved from the server to the client. The best way to troubleshoot this is to try and educe the links in the chain.

    Can you open a browser inside the servers LAN? Try on the server itself?  And note the timings, that might narrow it down further.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: page processed in 1s, browser receives data after 21s

    Sep 27, 2013 06:11 AM|JendaPerl|LINK

    Right. I should have tried this before. IIS is innocent.

    If I run the browser inside the server's LAN, it works file all the time so it must be either the firewall or something further along the road.

    Thanks anyway, Jenda

    --------------------------------------------------
    http://jendaperl.blogspot.com