当网站停止时,Oracle 数据提供程序会挂起 IIS 工作进程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2782169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle data provider pegs IIS worker process when web site is stopped
提问by Greg Smalter
We're experiencing a nasty issue in Oracle 11g Release 2 where the w3wp process takes over and entire processor core, and debugging shows that the Oracle data provider is throwing ThreadAbortExceptions infinitely. A developer found this issue by doing the following:
我们在 Oracle 11g 第 2 版中遇到了一个令人讨厌的问题,w3wp 进程接管了整个处理器内核,调试显示 Oracle 数据提供程序无限抛出 ThreadAbortExceptions。开发人员通过执行以下操作发现了此问题:
1) Browse a web site that uses Oracle data connections locally (http://localhost/OracleWebSite- we use IIS, not the ASP.NET dev server, for all of our sites). This ensures that the w3wp process is running and that an active Oracle pool of connections exists in the app pool.
1) 浏览本地使用 Oracle 数据连接的网站(http://localhost/OracleWebSite- 我们使用 IIS,而不是 ASP.NET 开发服务器,用于我们所有的站点)。这可确保 w3wp 进程正在运行,并且应用程序池中存在活动的 Oracle 连接池。
2) Stop the web site (or perform a Rebuild All operation in Visual Studio on the web site in question).
2) 停止网站(或在相关网站上的 Visual Studio 中执行“全部重建”操作)。
Our Oracle connection handling in the affected applications (all Oracle web apps) is well-established and robust. This issue does not occur if we disable connection pooling. This issue does not occur in Oracle 11g Release 1.
我们在受影响的应用程序(所有 Oracle Web 应用程序)中的 Oracle 连接处理完善且稳健。如果我们禁用连接池,则不会发生此问题。在 Oracle 11g 第 1 版中不会出现此问题。
采纳答案by Sam Rueby
This has been resolved. The fix is released in Oracle 11.2.0.1.2, which is available through the oracle.com website.
这已得到解决。该修复程序在 Oracle 11.2.0.1.2 中发布,可通过 oracle.com 网站获得。
Unfortunately the fix is currently only available through a "My Oracle Support" account.
不幸的是,该修复程序目前只能通过“My Oracle Support”帐户获得。
This has been fixed in 11.2.0.2 and in Patch 9966926 ORACLE 11G 11.2.0.1 PATCH 5 BUG FOR WINDOWS (64-BIT AMD64 AND INTEL EM64T).
Or WORKAROUND: is to disable self tuning by adding "Self Tuning=false" to the connection string.
这已在 11.2.0.2 和 Patch 9966926 ORACLE 11G 11.2.0.1 PATCH 5 BUG FOR WINDOWS(64 位 AMD64 和 INTEL EM64T)中修复。
或 WORKAROUND:是通过将“Self Tuning=false”添加到连接字符串来禁用自调整。
回答by scottt732
Anything that triggers a recompile (web.config change, app_offline.htm, .aspx file change, etc.) causes the CPU usage on the core to max out. If you repeat the process, it maxes out the CPU usage on the next core, until the overall CPU usage is at 100%.
任何触发重新编译的事情(web.config 更改、app_offline.htm、.aspx 文件更改等)都会导致核心上的 CPU 使用率达到最大值。如果重复该过程,它会最大限度地提高下一个核心的 CPU 使用率,直到整体 CPU 使用率达到 100%。
I hooked up windbg with sos extensions and it looks like for each maxed out core there is 1 thread stuck in System.AppDomain.Unload(System.AppDomain) and another stuck on Oracle.DataAccess.Client.OracleTuningAgent.DoScan().
我用 sos 扩展连接了 windbg,看起来每个最大化的核心都有一个线程卡在 System.AppDomain.Unload(System.AppDomain) 中,另一个线程卡在 Oracle.DataAccess.Client.OracleTuningAgent.DoScan() 中。
First thread
第一个线程
- Oracle.DataAccess.Client.OracleTuningAgent.DoScan()
- Oracle.DataAccess.Client.OracleTuningAgent.TuningFunction()
- System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
- System.Threading.ThreadHelper.ThreadStart()
- Oracle.DataAccess.Client.OracleTuningAgent.DoScan()
- Oracle.DataAccess.Client.OracleTuningAgent.TuningFunction()
- System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
- System.Threading.ThreadHelper.ThreadStart()
Second thread
第二个线程
- System.AppDomain.Unload(System.AppDomain)
- System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain(System.Object)
- System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
- System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading. _ThreadPoolWaitCallback)
- System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)
- System.AppDomain.Unload(System.AppDomain)
- System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain(System.Object)
- System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
- System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback)
- System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(System.Object)
It looks like AppDomain.Unload is waiting on OracleTuningAgent.DoScan to finish, but that thread is blocked or sleeping.
看起来 AppDomain.Unload 正在等待 OracleTuningAgent.DoScan 完成,但该线程被阻塞或休眠。
Oracle has confirmed the issue (bug # 9648040) and it is a top priority. In the meantime, the possible workarounds are:
Oracle 已经确认了这个问题(错误号 9648040)并且它是重中之重。同时,可能的解决方法是:
- Roll back to 11gR1/earlier client
- Add 'Self Tuning=false' to the connection string. You will of course lose the benefits of the automatic tuning.
- 回滚到 11gR1/更早的客户端
- 将“Self Tuning=false”添加到连接字符串。您当然会失去自动调谐的好处。
-Scott
-斯科特