Understanding heartbeat in ASP.NET health monitoring

痴心易碎 提交于 2019-12-07 15:00:39

问题


Who's triggering the event? What are consequences/benefits of enabling it in <healthMonitoring enabled="true" heartbeatInterval="30"> except it appears every 30 seconds in the logs? Has it anything to do with NLB heartbeat? What interval is better for production use?


回答1:


Enabling it in this way in the web.config will cause the Application Domain to raise a WebHeartbeatEvent periodically (in your case every 30 seconds), basically to check if your application is 'still alive' (like checking a human's heartbeat). You can specify additional rules like this:

<healthMonitoring enabled="true" heartbeatInterval="100">
  <rules>
    <add name="Heart Beat Events"
      eventName="Heartbeats"
      provider="EventLogProvider"
      profile="Default"
      minInterval="00:01:00" />
  </rules>
</healthMonitoring>

Specifying 'EventLogProvider' will cause the events to be logged to the EventLog, but you could also write your own Provider, see here.

It has nothing to do with the NLB heartbeat by the way, which is only used for Load Balancing purposes.



来源:https://stackoverflow.com/questions/7722161/understanding-heartbeat-in-asp-net-health-monitoring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!