简体   繁体   English

查找跨服务器内存泄漏

[英]Locating a cross-server memory leak

I have a social network based on elgg open source platform (PHP) and I've been having some memory related problems with it. 我有一个基于elgg开源平台(PHP)的社交网络,并且一直遇到一些与内存相关的问题。

Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 23456789 bytes) in somefile.php

My web application architecture contains 2 apache web servers (linux) with a load balancer between them. 我的Web应用程序体系结构包含2个apache Web服务器(Linux)以及它们之间的负载平衡器。 about 3-4 times a day the web application collapses and it takes about 2-3 mins for it to go back up again by its own. 每天大约有3-4次Web应用程序崩溃,并且需要大约2-3分钟才能再次恢复其运行状态。 Knowingly this is just a patch (an ugly one as well) I upgraded the memory on both of the servers and I updated the php.ini to memory_limit = 512M. 知道这只是一个补丁(也是一个丑陋的补丁),我在两个服务器上都升级了内存,并将php.ini更新为memory_limit = 512M。 I know i still need to locate the memory leak but i just wanted to see how bad was it, and to see if it actually helps. 我知道我仍然需要定位内存泄漏,但是我只是想看看它有多严重,并查看它是否真的有帮助。

My real question is: since i have two web servers running the code, how come the entire application collapse and not just one of the servers each time? 我真正的问题是:由于我有两个运行代码的Web服务器,为什么整个应用程序崩溃而不是每次都崩溃其中一个服务器?

Thanks in advance, Itay 在此先感谢,伊泰

In this case the problem was that the settings in the .htaccess file were overriding the php.ini. 在这种情况下,问题在于.htaccess文件中的设置将覆盖php.ini。

I figured it out thanks to Pawel Sroka's comment. 我想通了Pawel Sroka的评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM