views:

153

answers:

4

Over this past Christmas holiday week, when the website I work on was experiencing very low traffic, we saw several Request timed out exceptions (one on each day >> 12/26, 12/28, 12/29, and 12/30) on several pages that require user authentication. We rarely saw Request timed out exceptions prior to this very low traffic week.

It is possible that the application had no logged in users for some time before the Request timed out errors. But the exceptions were not on the login page but after the user had logged in. As noted earlier the exceptions were on pages that require user authentication.

Any ideas on what is causing this problem? Seeing that it is during very low traffic times it probably only affected the few customers that were working on the site but still I would like to understand this more.

This is an ASP.NET Web Forms application (using Forms Authentication) running on IIS7 on Windows Server 2008. SQL Server 2005 database.

+1  A: 

Without knowing much about your setup or code, my best guess is that it might be due to memory being released from inactivity, or Hard Disks winding down, or a similar occurrence. Apart from that, it doesn't seem to make much sense to have an application perform worse when traffic is low.

Sukasa
Could it be SQL Server that took the time to get up and running and caused the timeout? Login is performed in a separate database than the application (although on the same database server). Is there a way to specify a minimum sql server "attention" to a particular database?
Jeff Widmer
I can't say I'd know much about having SQL keep the databases active, but if Anonymous and subscribed users use different databases, and the login database is large enough, this could be your issue.
Sukasa
A: 

You haven't given us enough information to help diagnose any sort of issue. My first inclination when you mentioned Time Outs could be due to memory leaks. How are you connecting to the database and are you keeping any sort of readers open for too long? Check any resources you may use in your application and use a try catch finally block so that the finally block disposes and cleans up any sort of intensive resource.

JonH
I am pretty sure all connections are closed properly and try catch finally blocks have been implemented too. How could a memory leak cause the timeout when there is so low traffic? I would expect to see that during high traffic times.
Jeff Widmer
Doesn't matter how many people are on the site when it comes to a memory leak. I don't know or haven't seen you post the code so I can't tell what is causing it. It was just the first thing that I thought of. Resource might be taking down the entire site. Has happened to the best of us!
JonH
A: 

In IIS7 each app pool has an idle timeout (default 20 minutes if I remember correctly). so if your website is idle for this period of time the apppool will be shut down and will have to be restarted when someone requests a page. It is not uncommon for IIS to be a bit slow when starting up, so the first customer to request a page after the apppool has been shut down is likely to get a request timeout. You can overcome this by setting a higher timeout on the apppool in inetmgr -> application pools -> advanced settings.

klausbyskov
But anonymous requests did not time out nor did the login so the app pool must have been around. No??
Jeff Widmer
A: 

This windows service solves the problem by requesting a list of web pages at a configurable amount of time in affect keeping the web site "alive". My application domain cache no longer times out and users no longer experience unacceptable response times on my web site.

This solution works great for DotNetNuke, Community Server and SQL Reporting Services applications. The service is effective when installed on any computer with a permanent internet connection (T1, Cable, DSL...). Unlike similar products, you get the source code which is simple to modify.

http://www.spikesolutions.net/ViewSolution.aspx?ID=c2b7edc0-5de1-4064-a432-05f6eded3b82

Joe Smith