Request timed out when very low traffic over Christmas Holiday week
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 a开发者_运维知识库pplication 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.
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.
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.
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.
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
精彩评论