昨天協(xié)助一個朋友處理了他們公司服務(wù)器上面IIS應(yīng)用程序池頻繁崩潰的問題 。
1.錯誤日志文件如下
【注意】 該文件位于 C:\WINDOWS\system32\LogFiles\HTTPERR 目錄下
另外,IIS還會有一個日志,就是下面屬性窗口中指定的
分析下來,這個錯誤日志中主要包含了三類錯誤
2009- 05-30 10:43:27 203.208.60.137 48675 210.192.111.49 80 HTTP/1.1 GET /showroom/vulpes/product-detail/LRPST/Rubber-Series - 2006987705 Connection_Abandoned_By_AppPool MyApplicationPool?。哼@個 錯誤是說,連接被強制拋棄。
2009-05-30 11:25:50 211.167.234.158 13284 210.192.111.49 80 - - - - - Timer_ConnectionIdle -
2009-05-30 10:53:05 211.139.116.67 27664 210.192.111.49 80 - - - - - Timer_MinBytesPerSecond - 這兩個錯誤是與時間有關(guān)的。
2.分析錯誤原因
對于Timer_ConnectionIdle和 Timer_MinBytesPerSecond ,可以考慮下面的處理措施
IIS6.0系統(tǒng)日志 中出現(xiàn)此錯誤Timer_MinBytesPerSecond, Timer_ConnectionIdle
Description: The Error means The connection with the server has been terminated.
問題描述:這個錯誤是由于服 務(wù)器連接被中斷導(dǎo)致的。
If you check out the C:"Windows"system32"LogFiles"HTTPERR"httperr*.log files on the distribution server, you'll likely see either Timer_MinBytesPerSecond errors or Timer_ConnectionIdle errors.These are caused by IIS' default settings, contained within its metabase, which define the minimum traffic flow rate for a connection to be kept alive and the maximum idle time allowed before a connection is dropped.For some reason, SUS servers seem to take their good old time while downloading updates, and these parameters are exceeded and the distribution server drops 'em.
這個問題是由于在某些應(yīng)用下,IIS的默認設(shè)置不當?shù)?/P>
1) From IIS Manager, right click on the Internet Information Server (IIS) Manager root level folder and go to Properties.Check the box to enable direct metabase editing.Click OK.
1)打開Internet 信息服務(wù)(IIS )管理器,右鍵點“我的計算機”——屬性,選上 “允許直接編輯配置數(shù)據(jù)庫(N)”,確定。
2) Open the C:\Windows\system32\inetsrv\MetaBase.xml file in Notepad.Do a search for "MinFileBytesPerSec".Change the setting for MinFileBytesPerSec from 240 to 0.Do another search, this time for "ConnectionTimeout" to be 600.Save changes and exit.
2)編輯 C:"Windows"system32"inetsrv"MetaBase.xml文件,把MinFileBytesPerSec 參 數(shù)值從240改為0,把ConnectionTimeout參數(shù)設(shè)成600。
3) Restart the IIS Admin service to effect the changes.
對于 Connection_Abandoned_By_AppPool 的錯誤,經(jīng)過分析大多都是因為應(yīng)用程序本 身的異常導(dǎo)致了程序池的工作進程不斷重啟。為此,我用了一個global.asax文 件,來接管所有未處理的異常
<%@ Application Language="C#" %>
<%@ Import Namespace="System.IO" % >
<script RunAt="server">
protected void Application_Error(object sender, EventArgs e)
{
string errorLog = Server.MapPath("Error.log");
FileStream fs = new FileStream (errorLog,FileMode.Append,FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("時間:{0},錯誤消息:{1},地址:{2}", DateTime.Now.ToString(), Server.GetLastError ().InnerException.Message,Request.Url.AbsolutePath);
Server.ClearError();
sw.Close();
}
</script>
同時,一定要確保web.config中將調(diào) 試模式設(shè)置為false
該文章在 2011/2/28 16:51:15 編輯過