简体   繁体   English

阿帕奇内存泄漏

[英]Apache memory leak

I am using Apache 2.2 on Windows and I can see steady increase in memory for httpd process.我在 Windows 上使用 Apache 2.2,我可以看到 httpd 进程的内存稳步增加。 I used FastMM memory manager to find memory leaks and while I found some and cleared them and while FastMM is not finding anything anymore, my httpd memory still keeps increasing until it reaches ~2GB cap and crashes.我使用 FastMM 内存管理器来查找内存泄漏,虽然我发现了一些并清除了它们,而 FastMM 没有找到任何东西,但我的 httpd 内存仍然不断增加,直到达到 ~2GB 上限并崩溃。

What are some good strategies / tools to deal with such situations?有什么好的策略/工具来处理这种情况?

This is not a website and there is no PHP involved.这不是一个网站,也没有涉及 PHP。 We have our custom Apache module (.so) which acts as a server handling SOAP requests that can do inserts, deletes, updates, queries on database.我们有我们的自定义 Apache 模块 (.so),它充当处理 SOAP 请求的服务器,可以对数据库进行插入、删除、更新、查询。 Requests are coming from barcode scanning devices.请求来自条码扫描设备。

Much appreciated,非常感激,

This is a problem with Apache and also happens with version 2.4 for Windows.这是 Apache 的问题,Windows 2.4 版也会出现此问题。 Easy fix is to set the MaxRequestsPerChild setting in the http default conf file in extra to a number between 200000 and 1000000, in the Windows section at the bottom of that file, and restart Apache.简单的解决方法是将 http 默认 conf 文件中的 MaxRequestsPerChild 设置额外设置为 200000 和 1000000 之间的数字,在该文件底部的 Windows 部分,然后重新启动 Apache。 Memory usage still climbs but it resets itself automatically before the usage climbs high enough to crash the server.内存使用量仍在攀升,但它会在使用量攀升到足以使服务器崩溃之前自动重置。 HTH.哈。

I found out that setting your "DirectoryIndex" in httpd.conf in the real order (use Notepad++ to count files or just estimate)我发现按照实际顺序在 httpd.conf 中设置您的“DirectoryIndex”(使用 Notepad++ 来计算文件或只是估计)

Found the information here: HTTPD Apache Docs在这里找到信息: HTTPD Apache Docs

I had 25 index.php files and 161 index.html files.我有 25 个 index.php 文件和 161 个 index.html 文件。

From 25% CPU and 4 Gb memory, Now I'm mostly at 0% CPU and 10-11 Mb memory.从 25% CPU 和 4 Gb 内存开始,现在我主要使用 0% CPU 和 10-11 Mb 内存。

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

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