ASP.NET Web应用程序不卸载部署后的AppDomain

编程入门 行业动态 更新时间:2024-10-25 18:23:14
本文介绍了ASP.NET Web应用程序不卸载部署后的AppDomain的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我们部署我们的Web应用程序,我们复制所有code到一个新的目录,然后指向IIS到新目录中。当我们做到这一点的AppDomain数的增加,但从来没有减少。此外,我们的Application_End事件似乎永远不会触发。

When we deploy our web application we copy all the code to a new directory and then point iis to that new directory. When we do this the number of appdomains increases but never decreases. Also, our Application_End event never seems to fire.

有关一些未知的时间,而应用程序域的两个集都尚通过性能监视器报告,系统执行很差GC中尖峰为100%,而%的时间。最后,我回收应用程序池来获得应用程序流畅运行再次

For some unknown time, while both sets of AppDomains are still reported by perfmon, the system performs very poorly while % time in GC spikes to 100%. Eventually I recycle the app pool to get the app running smoothly again.

附加一块信息:列出的AppDomain我开发的机器上显示2,但4现场服务器上运行......我们只是在池中运行一个应用程序所以这意味着我们使用一些库创建应用程序域。

我应该怎么做,以尝试调试发生了什么?什么会prevent一个应用程序域卸载从

What should I do to try to debug what's happening? What would prevent an app domain from unloading?

更新2014年9月3日

在得到它看起来像问题的一些更详细的日志信息并非酒店周围的老应用程序域,它的重新启动过程中创造了新的应用程序域。相反入手一部新实例的应用程序,它启动两个。有时候,我们从旧的实例application_end得到,有时候我们不知道。

After getting some more detail log information it looks like the problem is not old app domains staying around, it's new appdomains created during restart. Instead of the application starting one new instance, it starts two. Sometimes we get application_end from the old instance, sometimes we don't.

更新2014年9月4日

这两个事情正在发生。使用进程管理器,我可以看到,旧的应用程序域仍然存在,一个新的开始的机器之一。在其他计算机上,只有2应用程序域,但有他们的顺序ID的差距。于是两个实例开始(我们也得到应用开始的日志消息),其中一人离开了人世几乎是瞬间,留下2应用程序域。

Both things are happening. Using process explorer I can see on one of the machines that the old app domain is still there and a new one has started. On the other machine there were only 2 app domains but there was a gap in their sequential ids. So two instances started (we also get a log message from app start), one of them died off almost instantly, leaving 2 app domains.

推荐答案

虽然我不知道这是唯一的原因,应用程序不卸载应用程序域,它肯定是一个原因。实际的答案是有趣的要少得多比我以前的步骤看着办吧。

Although I am not sure this is the ONLY reason the app was not unloading appdomains, it certainly is one reason. The actual answer is much less interesting than the steps I used to figure it out.

  • 我写了一个小Ruby脚本,只是以在对付我们的应用程序10个线程的请求100S(设置启动JMeter将采取比这更多的时间)。
  • 运行脚本和应用程序的配置文件很多次,而它跑所做的更改。这花了几分钟的时间。
  • 我使用Process Explorer的确认,有确实仍然加载到进程4应用程序域。
  • 我跑procdump和创建转储文件。
  • 加载procdump文件到Visual Studio,并点击调试只用管理(虽然我不知道如果bug在管理code与否)
  • 调试器停在一条线code哪里调用Application_End线程在等待队列来完成处理。通过查看变量的值,我可以告诉大家,队列不再打算处理项目,但我们要等到队列为空。
  • 改变了code和从头再来的过程,这次全部由我改变web配置启动应用程序域被卸载了。
  • 更多推荐

    ASP.NET Web应用程序不卸载部署后的AppDomain

    本文发布于:2023-11-13 10:26:00,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1584124.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:应用程序   NET   ASP   AppDomain   Web

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!