none
請問... ASP.NET 網站莫名其妙重起的問題 RRS feed

  • 一般討論

  • 大家好,

    我寫的一個 ASP.NET 網站一直莫名其妙的停止又重開, 我已經把所有回收都關掉了還是一樣... 於是我用了以下的 log 想找錯誤 (PS. 網站是架在 VPS 上, 不過沒有看出記憶體使用有問題)

        void Application_Start(object sender, EventArgs e) 
    
        {
    
            ConstClass.Error_Log("^^** Application Start -----------------------^^");
    
            
    
            System.Threading.Thread start_game_thread = new System.Threading.Thread(new System.Threading.ThreadStart(Start_Game_Thread));
    
            start_game_thread.Start();
    
        }
    
    
    
        private void Start_Game_Thread()
    
        {
    
            // 給予程式 30 秒 Loading 時間
    
            System.Threading.Thread.Sleep(30000);
    
    
    
            Thread_Alive = true;        
    
            while (Thread_Alive)
    
            {
    
                try
    
                {
    
                    // 程式內容
    
    
    
                    System.Threading.Thread.Sleep(GameClass.REFRESH_TIME);
    
                }
    
                catch (Exception e)
    
                {
    
                    ConstClass.Error_Log(e);
    
                }
    
            }
    
        }
    
        
    
        void Application_End(object sender, EventArgs e) 
    
        {
    
            ConstClass.Error_Log("^^** Application End -------------------------^^");
    
    
    
            Thread_Alive = false;
    
        }
    
            
    
        void Application_Error(object sender, EventArgs e) 
    
        { 
    
            Exception ex = Server.GetLastError().GetBaseException();
    
    
    
            ConstClass.Error_Log("^^** Application Error -----------------------^^");
    
            ConstClass.Error_Log(ex);
    
        }
    
    
    
        void Session_Start(object sender, EventArgs e) 
    
        {
    
            Session.Timeout = 20;
    
            ConstClass.Error_Log("Session Start " + Session.SessionID + " (" + Session.Keys.Count + ")");
    
        }
    
    
    
        void Session_End(object sender, EventArgs e) 
    
        {
    
            ConstClass.Error_Log("Session Ended " + Session.SessionID + " (" + Session.Keys.Count + ")");
    
        }
    
    
    
    
    
    



    以下是 log 記錄下的內容

    6/21/2009 4:37:01 PM : ^^** Application Start -----------------------^^
    6/21/2009 4:37:03 PM : Session Start hrd1ffj0rpjwfrfzeco2spin (0)
    6/21/2009 4:37:05 PM : Session Start pjg3labsfkoi01450i4n5455 (0)
    6/21/2009 4:37:06 PM : Session Start hrd1ffj0rpjwfrfzeco2spin (0)
    6/21/2009 4:37:10 PM : Session Start bigkgn55yntuyefukipe0rqg (0)
    6/21/2009 4:37:13 PM : Session Ended hrd1ffj0rpjwfrfzeco2spin (1)
    6/21/2009 4:37:13 PM : Session Ended hrd1ffj0rpjwfrfzeco2spin (1)
    6/21/2009 4:38:20 PM : Session Start u3nfx345q4b2yy45tlkf0r45 (0)
    6/21/2009 4:40:25 PM : Session Start fdenvi45nw1ugf45vfu5cn55 (0)
    6/21/2009 4:40:57 PM : Session Start 1ophsz550dgaxg55jkihdhyg (0)
    6/21/2009 4:41:51 PM : Session Start nt12bhril3tb1032fswhdszl (0)
    6/21/2009 4:43:45 PM : Session Start ucsfcenvm0hsy555cmir2v55 (0)
    6/21/2009 4:43:56 PM : Session Start unl4oyev3dw4vcqfkyunut3d (0)
    6/21/2009 4:43:58 PM : Session Start bi2ufb45esm1nofaeon3rc45 (0)
    6/21/2009 4:44:17 PM : Session Start mwrbix55d1wwk455xa3vk555 (0)

    中間省略... 之後突然就...

    6/21/2009 8:01:22 PM : Session Ended xx5ujp55tqtfrg55z1exfzbl (1)
    6/21/2009 8:01:22 PM : Session Ended 5p4znofxkjnmuvf5k0xlbeik (4)
    6/21/2009 8:01:22 PM : Session Ended wvcr0kjrmb4zrs55yi1pqcvq (6)
    6/21/2009 8:01:22 PM : Session Ended zhxq2nfprqpcqyzyf2gbhpzj (9)
    6/21/2009 8:01:22 PM : Session Ended ru5mff45hxenw045lfzfcb45 (5)
    6/21/2009 8:01:22 PM : Session Ended 0iwfvx2buk22a245i4hz2p55 (6)
    6/21/2009 8:01:22 PM : Session Ended su4wfjbegeshym45eaw0qj45 (1)
    6/21/2009 8:01:22 PM : Session Ended wn0xiozwvovt1y45mo1jwi55 (3)
    6/21/2009 8:01:22 PM : Session Ended v3eo1uicydrs4pzrkcz4dr55 (1)
    6/21/2009 8:01:22 PM : Session Ended d32spffqs5pmpiibw4hl553k (1)
    6/21/2009 8:01:22 PM : Session Ended noohevbpgubzq055daqoiemh (3)
    6/21/2009 8:01:22 PM : Session Ended gtjfdb55ka5vmm455mospz55 (7)
    6/21/2009 8:01:22 PM : Session Ended wwa0ta55xjttt5u5lxtdsz45 (5)
    6/21/2009 8:01:22 PM : Session Ended xnvu05nl520a5255khuggleu (1)
    6/21/2009 8:01:22 PM : Session Ended l1ds40ay4hbbd4ua40v0eba0 (1)
    6/21/2009 8:01:22 PM : Session Ended cel0ja45ofecvs55zkr0ika2 (1)
    6/21/2009 8:01:22 PM : Session Ended u3nfx345q4b2yy45tlkf0r45 (4)
    6/21/2009 8:01:22 PM : Session Ended omanan55ffk4xhnuz0ozglzl (1)
    6/21/2009 8:01:22 PM : Session Ended 1ouizu45duvfs5550im1bh55 (4)
    6/21/2009 8:01:22 PM : Session Ended orii5ff0dh12ei55lxwhdz45 (6)
    6/21/2009 8:01:22 PM : Session Ended 4yk2im2tq2g5rvfjtiq10c45 (4)
    6/21/2009 8:01:22 PM : Session Ended h5okxc55vcm5xwy1laucwlvp (4)
    6/21/2009 8:01:22 PM : Session Ended icqjlbq0a2p0pw55h4vsn355 (4)
    6/21/2009 8:01:22 PM : Session Ended gyjkyf55b3euid55waar41vs (1)
    6/21/2009 8:01:22 PM : Session Ended wxvufmevu12ql345cyslac45 (3)
    6/21/2009 8:01:22 PM : Session Ended zzjffm554yrjqa2ybaxm4iz3 (9)
    6/21/2009 8:01:22 PM : Session Ended b3od0f45v2stlprdhwvobsve (6)
    6/21/2009 8:01:22 PM : Session Ended svh4mprydqf2maztzpwguh45 (4)
    6/21/2009 8:01:22 PM : Session Ended a4rqujztq1o5sn45z3hmgl55 (1)
    6/21/2009 8:01:22 PM : Session Ended f0ilds45dcvfic55dmvnlubq (3)
    6/21/2009 8:01:22 PM : Session Ended icsqw455rp2bkxuxz1h321bf (3)
    6/21/2009 8:01:22 PM : Session Ended 11wthxervswpqc55m3kef4im (1)
    6/21/2009 8:01:22 PM : Session Ended dy4gxi55vysd5cuxzdhnhg45 (1)
    6/21/2009 8:01:22 PM : Session Ended mzpidyzjucifi1au2qu153up (5)
    6/21/2009 8:01:22 PM : Session Ended ld1w0nju4t2bghmsynkjygeh (4)
    6/21/2009 8:01:22 PM : Session Ended dju1d3ikibqakrvzbl3oyw45 (1)
    6/21/2009 8:01:22 PM : Session Ended wvwvioahpdmxw045iqw33355 (4)
    6/21/2009 8:01:22 PM : Session Ended s3ijhp4530jwb5vydeq5sfv2 (4)
    6/21/2009 8:01:22 PM : Session Ended kyza3jr4ddtpno55qkf0nxy2 (4)
    6/21/2009 8:01:22 PM : Session Ended fojawl55gq3rm3bx0tljgt55 (0)
    6/21/2009 8:01:22 PM : Session Ended jy2eucragk3xjxmynjtffkus (4)
    6/21/2009 8:01:22 PM : Session Ended 5ln2212hod4h2hjxeddnhx45 (4)
    6/21/2009 8:01:22 PM : Session Ended biobru452jgpmp45c3zxksr5 (3)
    6/21/2009 8:01:22 PM : Session Ended yk2bi22an0r2jl55lvuixru2 (4)
    6/21/2009 8:01:22 PM : Session Ended vaxbx355fmoismnyrom4tp55 (1)
    6/21/2009 8:01:22 PM : Session Ended d10kan555mwce0a5h40n2b55 (4)
    6/21/2009 8:01:22 PM : Session Ended y4wskfz4h02ytg452ji4eb45 (4)
    6/21/2009 8:01:22 PM : Session Ended qfyz0045gl1bry55gq31glid (5)
    6/21/2009 8:01:22 PM : Session Ended krypety4azssmu55piiqki45 (6)
    6/21/2009 8:01:22 PM : Session Ended mmngfqfvjztixk45xxl2p3rj (3)
    6/21/2009 8:01:22 PM : Session Ended uhxodr55koazh555c5huhs45 (1)
    6/21/2009 8:01:22 PM : Session Ended q520or55dixhjny1jcoqv3v3 (3)
    6/21/2009 8:01:22 PM : Session Ended 2mnvjq555jqcchv22chjvcy0 (3)
    6/21/2009 8:01:22 PM : Session Ended mdpfmb45opmdoe45uwga0q55 (3)
    6/21/2009 8:01:22 PM : Session Ended kwp1nfinai0xidqtqwug5h45 (1)
    6/21/2009 8:01:22 PM : Session Ended m254agiagtlpmt45zzw5v2az (3)
    6/21/2009 8:01:22 PM : Session Ended mwrbix55d1wwk455xa3vk555 (4)
    6/21/2009 8:01:22 PM : Session Ended ozsbcs55poinqp55r5jsjd55 (3)
    6/21/2009 8:01:22 PM : Session Ended nt12bhril3tb1032fswhdszl (6)
    6/21/2009 8:01:22 PM : Session Ended ones0q45mxaq5zfwsfsbp23r (1)
    6/21/2009 8:01:22 PM : Session Ended rjn0z0rhgxe5pmfgs4c0tlm1 (1)
    6/21/2009 8:01:22 PM : Session Ended pa4zgb45u31fr4vwcv4dfzml (4)
    6/21/2009 8:01:22 PM : Session Ended mqour1452kacnjfttv3lguej (5)
    6/21/2009 8:01:22 PM : Session Ended 1maynj453ehprg452k3yiwqk (1)
    6/21/2009 8:01:22 PM : Session Ended feu1a5zqeqkvx3fdkpdvpa55 (1)
    6/21/2009 8:01:22 PM : Session Ended mrxx03igz45yxeqzhssjroan (1)
    6/21/2009 8:01:22 PM : Session Ended uyctdvn4p3pzxkfqntdahj45 (4)
    6/21/2009 8:01:22 PM : Session Ended qlufcj55zplpd12jvzn5u045 (5)
    6/21/2009 8:01:22 PM : Session Ended clulccy5cldkosnwcvxjl555 (3)
    6/21/2009 8:01:22 PM : Session Ended xcgmf155s0vgyb55a4rcctuq (6)
    6/21/2009 8:01:22 PM : Session Ended qr3w5rvopjvcwa45gbik2l45 (1)
    6/21/2009 8:01:22 PM : Session Ended zqd4p445damztpjwwgry4fqh (3)
    6/21/2009 8:01:22 PM : Session Ended qoybmxa4cbnr0tvnmcrnwd45 (4)
    6/21/2009 8:01:22 PM : Session Ended vzsu0g45wev0w0vv4g0g52ma (3)
    6/21/2009 8:01:22 PM : Session Ended lbtr3t55fd2m5j45lab0kmqm (1)
    6/21/2009 8:01:22 PM : Session Ended gutf54450bs5b2vxftj04e3m (1)
    6/21/2009 8:01:22 PM : Session Ended ng1fmr45numzl5bydgw40o45 (4)
    6/21/2009 8:01:22 PM : Session Ended lsxvlq31qiixl055yhindk55 (1)
    6/21/2009 8:01:22 PM : Session Ended lyqzv055qhfjtr55gpy2fk55 (3)
    6/21/2009 8:01:22 PM : Session Ended 5cscocelvszi513syrr3qy55 (4)
    6/21/2009 8:01:22 PM : Session Ended vl53wi30rbfjt555pjyrjy55 (4)
    6/21/2009 8:01:22 PM : Session Ended jdvc2jyzqtw2cnuixleupbfs (4)
    6/21/2009 8:01:22 PM : Session Ended lwv35x3b2rwce4452tzhni45 (3)
    6/21/2009 8:01:22 PM : Session Ended 4wp3as45ojiral55iuxpyava (3)
    6/21/2009 8:01:22 PM : Session Ended tqaty2yk3h3t2j452kagejvy (4)
    6/21/2009 8:01:22 PM : Session Ended z4mrm0flkcugww45oadakr45 (5)
    6/21/2009 8:01:22 PM : Session Ended hdk00ti5sgkyyr55rhkux155 (1)
    6/21/2009 8:01:22 PM : Session Ended nivdccbmwyhw3q55vsvs0255 (5)
    6/21/2009 8:01:22 PM : Session Ended j21cxwrstx2dp145lcfpsx55 (4)
    6/21/2009 8:01:22 PM : Session Ended bi2ufb45esm1nofaeon3rc45 (4)
    6/21/2009 8:01:22 PM : Session Ended ewansv45qjkeunzqzqkspd45 (4)
    6/21/2009 8:01:22 PM : Session Ended fkisepucvo1xzfv1ngj4uq55 (0)
    6/21/2009 8:01:22 PM : Session Ended npo2wg45hrhywa45jcu1xg55 (4)
    6/21/2009 8:01:22 PM : Session Ended dbzwtx4520iqwu55ikyqnjac (7)
    6/21/2009 8:01:22 PM : Session Ended brgq5045y13zgnnpzvcmrj3z (1)
    6/21/2009 8:01:22 PM : Session Ended rjdnzo55lhpsss454x0fvj55 (1)
    6/21/2009 8:01:22 PM : Session Ended msnok1454bowegjfugzyzo55 (5)
    6/21/2009 8:01:22 PM : Session Ended 0icpcr45bisctxe32awppi45 (1)
    6/21/2009 8:01:22 PM : Session Ended xwk05y55ok0sksnqvfulo1a4 (3)
    6/21/2009 8:01:22 PM : Session Ended uheh3445mfv1pyauqsizj455 (4)
    6/21/2009 8:01:22 PM : Session Ended qs3v2055ckfr1545wj5rnv3s (5)
    6/21/2009 8:01:22 PM : Session Ended nmizv4u1cbhhoa55shpw3c45 (4)
    6/21/2009 8:01:22 PM : Session Ended xxx1ns55b0n4jc45dplaeq55 (6)
    6/21/2009 8:01:22 PM : Session Ended oze5cvfkpaz21h55n0ql4t55 (4)
    6/21/2009 8:01:22 PM : Session Ended tmgh2jr00d4d4u552qefxd55 (5)
    6/21/2009 8:01:22 PM : Session Ended gqgctg45ujigaz55kyovonf2 (1)
    6/21/2009 8:01:22 PM : Session Ended v4cwdk45rpkicz45s1niojas (4)
    6/21/2009 8:01:22 PM : Session Ended unl4oyev3dw4vcqfkyunut3d (4)
    6/21/2009 8:01:22 PM : Session Ended uh3dkauejklauq45mrce0k45 (5)
    6/21/2009 8:01:22 PM : Session Ended 0rons3551txtp555mgfvqp45 (1)
    6/21/2009 8:01:22 PM : Session Ended 34nigy55zl2ssfue3dhicjzk (1)
    6/21/2009 8:01:22 PM : Session Ended 54dfzmajh5q3zt2onufjjxbf (5)
    6/21/2009 8:01:22 PM : Session Ended xm1bw355h3abel55plmgtkqc (1)
    6/21/2009 8:01:22 PM : Session Ended m1jp4tybnoeiduqjcozs1145 (1)
    6/21/2009 8:01:22 PM : Session Ended u5yy3lbaobmua2yyth45he45 (4)
    6/21/2009 8:01:22 PM : Session Ended xv40fuz3re3dwv55wonyohuw (1)
    6/21/2009 8:01:22 PM : Session Ended y5vintfz2o1eb0550pi3nd45 (3)
    6/21/2009 8:01:22 PM : Session Ended 0f3ogr2c3fcwk355r21sky45 (1)
    6/21/2009 8:01:22 PM : Session Ended zxo0l145ijidu2uzjjkugonp (7)
    6/21/2009 8:01:22 PM : Session Ended xelt0n45axdoom4542usphma (4)
    6/21/2009 8:01:22 PM : Session Ended wdfivz55aio5e5f5k5zacziy (1)
    6/21/2009 8:01:22 PM : Session Ended cyxb3v55ymg40eyophotldy5 (7)
    6/21/2009 8:01:22 PM : Session Ended cciiddacgfxeheqkp3scw0ne (4)
    6/21/2009 8:01:22 PM : Session Ended 312wj245mc5vjl45pp1f1j2n (1)
    6/21/2009 8:01:22 PM : Session Ended ebhtz555i1ymm5rdmn10gyjv (1)
    6/21/2009 8:01:22 PM : Session Ended us2qfi45mj2zepjnoen0bm2y (4)
    6/21/2009 8:01:22 PM : Session Ended aelpkd45fn0eahiga32ara55 (4)
    6/21/2009 8:01:22 PM : Session Ended vvu0t055ztufxefgwp5svz3k (5)
    6/21/2009 8:01:22 PM : Session Ended j0j0s2vcowqubu45afm1ehec (5)
    6/21/2009 8:01:22 PM : Session Ended ygwlbb55xwdk2w45uhsvao55 (5)
    6/21/2009 8:01:22 PM : ^^** Application End -------------------------^^

    突然間所有 Session 都 end, 然後就 application end.
    中間出現過幾次 application error, 不知道有沒有影響

    6/21/2009 5:01:13 PM : ^^** Application Error -----------------------^^
    6/21/2009 5:01:13 PM :
    Source        : System.Web
    Method        : DecryptString
    Error         : Object reference not set to an instance of an object.
    Stack Trace   : at System.Web.UI.Page.DecryptString(String s)
       at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    ^^-------------------------------------------------------------------^^
    6/21/2009 5:38:40 PM : ^^** Application Error -----------------------^^
    6/21/2009 5:38:40 PM :
    Source        : System.Web
    Method        : ValidateEvent
    Error         : Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
    Stack Trace   : at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument)
       at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument)
       at System.Web.UI.WebControls.TextBox.LoadPostData(String postDataKey, NameValueCollection postCollection)
       at System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
       at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ^^-------------------------------------------------------------------^^
    6/21/2009 5:40:23 PM : ^^** Application Error -----------------------^^
    6/21/2009 5:40:23 PM :
    Source        : mscorlib
    Method        : FromBase64String
    Error         : Invalid character in a Base-64 string.
    Stack Trace   : at System.Convert.FromBase64String(String s)
       at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
       at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
       at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
       at System.Web.UI.HiddenFieldPageStatePersister.Load()
    ^^-------------------------------------------------------------------^^
    6/21/2009 6:52:47 PM : ^^** Application Error -----------------------^^
    6/21/2009 6:52:47 PM :
    Source        : System.Web
    Method        : GetDecodedData
    Error         : Unable to validate data.
    Stack Trace   : at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)
       at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
    ^^-------------------------------------------------------------------^^
    6/21/2009 7:19:16 PM : ^^** Application Error -----------------------^^
    6/21/2009 7:19:16 PM :
    Source        : Microsoft JET Database Engine
    Method        : ExecuteCommandTextForSingleResult
    Error         : Could not update; currently locked.
    Stack Trace   : at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
       at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
       at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
       at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
       at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
       at System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation)
       at System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues)
       at System.Web.UI.WebControls.SqlDataSource.Delete()
       at Message.lbDeleteAll_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\CPBLOnline\Message.aspx.cs:line 76
       at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
       at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
       at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ^^-------------------------------------------------------------------^^


    另外, 這幾個 error 都沒有顯示出錯的地方, 不知道是在哪裡出的問題...


    希望高手能幫忙解答這幾個問題, 感謝!

    • 已移動 小朱MVP, Moderator 2009年6月22日 上午 02:44 ([Loc]From:Visual C#)
    • 已變更類型 Lolota Lee 2009年7月3日 上午 02:28 發問者未繼續回覆
    2009年6月22日 上午 12:43

所有回覆

  • 對了, 有時候還沒 Application End 就會看到 Application 又出現, 然後又看到幾個 Session Start, 之後才所有 Session End 然後 Application End. 有人知道這是怎麼回事嗎?
    2009年6月22日 上午 01:15
  • 除非 w3wp.exe 自己發生重新啟動 (例如預設記憶體使用量達實體記憶體 60%、整個使用相同集區的虛擬應用程式無回應重啟、以工作管理員或程式終結Process),否則一般狀況只是某個執行緒中斷,並不會造成應用程式掛掉重新啟動,除被終結 Process 外,w3wp.exe 重新啟動均會寫入事件,可針對此部分查詢。

    前面回應你這篇已經說過(http://social.msdn.microsoft.com/Forums/zh-TW/233/thread/f7d3708a-4185-484c-8a08-d0c93283d522):
    當網頁虛擬應用程式最後要求結束後,預設 20 分鐘內沒人存取,所有該虛擬應用程式產生的執行緒或資源都會被釋放。
    沒設 static 的話,會跟隨要求,預設 90 秒內結束,設 static 的話,跟隨虛擬應用程式,20 分鐘內沒人存取結束,兩種方式都會結束,所以才會不應該寫在網頁內有持續的執行緒再跑。

    你同時發生大量的 session end ,應該是正常結束,被終結的話,不會一個個 session 關閉,請確認最後一個該虛擬應用程式的存取動作時間點。


    論壇是網友平等互助 保證解答請至 微軟技術支援服務
    2009年6月22日 上午 06:51
  • 抱歉前面忘了講, 因為結束的時候是仍有大量使用者正在實用的情況下..
    我比較在意的是您提到的當記憶體達到 60% w3wp.exe 就會重新啟動嗎?

    因為網頁中使用了大量的 GridView 而且資料量非常龐大, 在網上查過之後發現 GridView 好像沒辦法正常是放記憶體?
    我的 VPS 記憶體限制是 250MB 而網站的記憶體用量時長達到 150MB 左右, VPS 總記憶體用量基本都在 180-190MB 左右, 是否因為這個關係導致 w3wp.exe 自動重啟呢?

    重啟之後理論上還說應該是會釋放記憶體? 不過有時候重啟之後沒幾分鐘又自動重啟, 實在想不通.
    另外, 我也注意過 w3wp.exe, 在自動重啟後 w3wp.exe 的 PID 卻沒有變?? 因此我之前一直以為程式沒有被重啟...

    非常感謝您的回覆, 不知道能否還能解答這些疑問? 謝謝!

    2009年6月22日 下午 01:58
  • 是實體的記憶體 60% (不含虛擬記憶體) ,可參考此篇:http://msdn.microsoft.com/zh-tw/library/ms954590.aspx

    重啟當然先前存在記憶體的東西都沒了,我記得最早曾經建議你用資料庫交換,這也是原因之一。PID 不一定會變,但是事件會寫,裡面會建議你增加實體記憶體。
    論壇是網友平等互助 保證解答請至 微軟技術支援服務
    2009年6月22日 下午 02:08
  • 不一定是網頁中使用了多少 GridView; 有幾個原因可能會讓你的網站重啟

    1. web.config 檔案被修改
    2. global.asax 被修改
    3. app_code 下的檔案被修改 (若是動態編譯)
    4. 網站資料夾中有檔案被修改或異動
    5. \bin 資料夾有異動
    6. 其它

    如果你習慣修改網站資料夾裡的檔案, 或許會突然引發網站重啟。光是使用 GridView 可能不是主因。


    ASP.NET 2Share - http://phone.idv.tw/cs2/
    2009年6月23日 上午 01:28
  • Hi,


    您的問題有解決了嗎?


    B.R.


    微軟技術支援中心(CSS) - http://www.dotblogs.com.tw/lolota/
    2009年6月29日 上午 02:05
  • 不好意思... 仍然沒有找出問題..
    Johnny.Net 題的幾個情況似乎都不是原因, 因為斷線的時候是我完全沒有在更新程式的時候...
    目前只能猜測是不是 VPS 的記憶體使用問題.. 因為放在自己的 Server 的時候完全不會出現這個狀況

    2009年6月29日 下午 02:28
  • 這方面最近我有經驗。請不要直接猜測試某段程式碼有問題,而必須以更務實的方法來找。也就是由 IIS 的 log,event log 等來找方向
    請參考我處理的過程 伺服應用程式集區 'DefaultAppPool' 的處理序已意外中止了。處理序識別碼為 '6060'。處理序結束碼為 '0x800703e9'。
    2009年6月30日 上午 12:51
  • 從狀況看來比較像是w3wp進行回收,回收的原因很多種:
    1.到了IIS設定的回收時間
    2.記憶體使用量過高
    3.自動保護機制被啟動
    4.人為動作


    又或者到C:\WINDOWS\system32\Logfiles\HTTPERR下去看您的Log是否有記錄到IIS的ERROR。

    另外您也可以嘗試關閉IIS的各種回收機制再確認看看是否還會有異常現象,先將問題做一些收斂才比較有機會解決此問題。
    2009年7月1日 下午 04:16
  • Hi,


    如果您把VPS的Memory調高到512MB, 這樣問題還會重現嗎 ?

    B.R.
    微軟技術支援中心(CSS) - http://www.dotblogs.com.tw/lolota/
    2009年7月2日 上午 02:58