XSLT存档  

不及格的程序员-八神

 查看分类:  ASP.NET XML/XSLT JavaScripT   我的MSN空间Blog
Viewed 15k times
strange situation with .Net OutOfMemoryExceptions in IIS / Windows 2008 R2 being thrown on random pages of the application being hit.

We have about 1000 separate sites that are the same .Net application (different codebase folders and app pools per site).

64 bit Windows and running .Net 2.0, application is compiled with 'AnyCPU' flag.

Since the same exact code works on the old server and never throws outofmemoryexceptions, we are holding off on spending major time profiling the application and examining dumps and performing code optimizations that would help avoid large object heap fragmentations (so we are hoping to get some hints on possible server configratuion issues that may be the culprit more than looking in the code base and optimizing it...).

Config 1 - Rackspace CloudSites (shared hosting, we can only FTP to it, no access to IIS settings):

1 IIS server, we don't have control over managing it but were told each app pool has a 250MB recycle limit.

Of our 1000 sites, many sites (20-50ish) apparently share the same app pool. We never get OutOfMemoryExceptions here and have the application running on it since years.

Config 2 - Rackspace Dedicated Server (full control):

Monster server with 128GB RAM, dedicated, each site has it's own app pool. All app pools have the same settings (350MB recycle limit). Not sure if this is of consequence but the page file size on this sever is 4GB (no idea what Config 1 has - does this need to be increased/addressed?).

Both configs are load balanced across 2 or 3 web servers, but that really doesn't matter here per se, since we are seing sites with NO TRAFFIC getting killed with OutOfMemoryExceptions.

asked Dec 3, 2013 at 21:27
0

Our issue was resolved by switching the 1000+ app pools to 32-bit mode instead of the default 64 bit.

We were able to confirm this by flipping back to 64-bit and immediately seeing the outofmemory exceptions.

I believe Jessen's points on the page file do have weight. . . since upping the page file required a system restart,

we tried to flip to 32-bit mode app pools (which doesn't require restarting) and got lucky.

If anyone has some interesting comments on this please feel free!

Thanks!


 

观看次数 15,000 次
IIS / Windows 2008 R2 中的 .Net OutOfMemoryExceptions 被抛出到被命中的应用程序的随机页面上,这是一种奇怪的情况。

我们有大约 1000 个独立的站点,它们都是相同的 .Net 应用程序(每个站点有不同的代码库文件夹和应用程序池)。

64 位 Windows 并运行 .Net 2.0,应用程序使用“AnyCPU”标志进行编译。

由于相同的代码在旧服务器上运行并且永远不会抛出内存不足异常,因此 我们推迟花费大量时间分析应用程序并检查转储并执行代码优化,这将有助于避免大型对象堆碎片(因此我们希望得到一些提示可能的服务器配置问题可能是罪魁祸首,而不仅仅是查看代码库并对其进行优化......)。

配置 1 - Rackspace CloudSites(共享主机,我们只能通过 FTP 访问它,无法访问 IIS 设置):

1 IIS 服务器,我们无法控制管理它,但被告知每个应用程序池有 250MB 的回收限制。

在我们的 1000 个网站中,许多网站(20-50 左右)显然共享相同的应用程序池。我们在这里从未遇到过 OutOfMemoryExceptions,并且多年来一直在其上运行应用程序。

配置 2 - Rackspace 专用服务器(完全控制):

拥有 128GB RAM 的 Monster 服务器,专用,每个站点都有自己的应用程序池。所有应用程序池都具有相同的设置(350MB 回收限制)。不确定这是否有影响,但该服务器上的页面文件大小为4GB(不知道配置 1 有什么 - 这是否需要增加/解决?)。

这两个配置都在 2 或 3 个 Web 服务器之间进行负载平衡,但这本身并不重要,因为我们看到没有流量的网站因 OutOfMemoryExceptions 被杀死。

询问于 2013 年 12 月 3 日 21:27
0

通过将 1000 多个应用程序池切换到 32 位模式而不是默认的 64 位模式,我们的问题得到了解决。

我们可以通过切换回 64 位并立即看到内存不足异常来确认这一点。

我相信杰森在页面文件上的观点确实有分量。由于升级页面文件需要重新启动系统,

我们尝试切换到 32 位模式应用程序池(不需要重新启动)并且很幸运。

如果有人对此有一些有趣的评论,请随意!

谢谢!


 

Asked 9 years, 11 months ago
 
 

This is Windows server 2008 R2, 64 bit, 32gb RAM, I think its running IIS 7.5. We have set the application pool to use 4 worker process.

This is a ASP.NET 4 application but running in 32 bit compatability mode.

We are getting oSystem.OutOfMemoryException when the memory usage crosses more than 650-700MB/worker process.

I thought that it should be able to handle upto 2gb or atleast 1.5 gb with no issues?

Another thing, why does it not recycle the worker process when there is a System.OutOfMemoryException?

update: This application works perfectly fine on a 64bit windows server 2003 with IIS6.0. I have seen the max memory usage of it being around 700mb/worker process.

Update: The reason for high memory usage is XML processing using DOM. We are going to start work to fix that, but thats a long term plan. I just find it weird that it cannot go higher than 650 mb.

 

 

 

 

 

 


 

posted on 2023-02-09 19:57  不及格的程序员-八神  阅读(23)  评论(0编辑  收藏  举报