今年夏天

随便写写,我的网络生活.

  DonewsBlog  |  Donews首页  |  Donews社区  |  Donews邮箱  |  我的首页  |  联系作者  |  聚合   |  登录
  249篇文章 :: 3篇收藏:: 239篇评论:: 28个Trackbacks

公告

[收藏]365Key|和讯网摘|博采|VIVI|狐摘

Bloglines订阅 Newsgator订阅 My Msn订阅 My Yahoo订阅 Rojo订阅 gougou订阅 周博通订阅 博阅订阅 Rsshow订阅 Google Reader

文章

收藏

相册

技术

相关参考

友情链接

存档


正在读取评论……


MSDN原文 ASP.NET Performance Monitoring, and When to Alert Administrators 下载源代码

Monitoring Performance Counters
Monitoring the Event Log
Monitoring the W3C and HTTPERR Logs
Other Resources Used to Monitor ASP.NET
Understanding the Performance Counters
   .NET CLR Exceptions Counter
   .NET CLR Loading Counters
   .NET CLR Memory Counters
   ASP.NET Counters
   ASP.NET Applications Counters
   Process Counters
   Processor Counter
   Memory Counter
   System Counter
   Web Service Counters
Conclusion

主要讨论的是如何使用ASP.NET的性能计数器。主要包括以下几个方面

  • Processor(_Total)\% Processor Time
  • Process(aspnet_wp)\% Processor Time
  • Process(aspnet_wp)\Private Bytes
  • Process(aspnet_wp)\Virtual Bytes
  • Process(aspnet_wp)\Handle Count
  • Microsoft® .NET CLR Exceptions\# Exceps thrown / sec
  • ASP.NET\Application Restarts
  • ASP.NET\Requests Rejected
  • ASP.NET\Worker Process Restarts (not applicable to IIS 6.0)
  • Memory\Available Mbytes
  • Web Service\Current Connections
  • Web Service\ISAPI Extension Requests/sec

如何在Application_Error事件中监视出错信息。

void Application_Error(Object sender, EventArgs ea) {
    StringBuilder message = new StringBuilder();
   
    if (Request != null) {
        message.AppendFormat(uriFormat, Request.Path);
    }
 
    if (Server != null) {
        Exception e;
        for (e = Server.GetLastError(); e != null; e = e.InnerException) {
            message.AppendFormat(exceptionFormat,
                                 e.GetType().Name,
                                 e.Message,
                                 e.StackTrace);
        }
    }

    if (!EventLog.SourceExists(sourceName)) {
        EventLog.CreateEventSource(sourceName, logName);
    }

    EventLog Log = new EventLog(logName, serverName, sourceName);
    Log.WriteEntry(message.ToString(), EventLogEntryType.Error);

    //Server.ClearError(); // uncomment this to cancel the error
}


.NET CLR Exceptions Counter  当运行Response.Redirect() Server.Transfer() Response.End() 会抛出ThreadAbortException错误,如果不想抛出错误,Response.Redirect(url,false)。

Application Restarts 以下为可能引发Application Restart 的情况

  • Modification of machine.config, web.config, or global.asax.
  • Modification of the application's bin directory or its contents.
  • When the number of compilations (ASPX, ASCX, or ASAX) exceeds the limit specified by <compilation numRecompilesBeforeAppRestart=/>.
  • Modification of the physical path of a virtual directory.
  • Modification of the code-access security policy.
  • The Web service is restarted.



Trackback: http://tb.donews.net/TrackBack.aspx?PostId=218626


[点击此处收藏本文]  发表于2004年12月28日 3:05 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论