zoukankan      html  css  js  c++  java
  • APACHE内存溢出

    简介:这是APACHE内存溢出的详细页面,介绍了和php,apache, php APACHE内存溢出有关的知识、技巧、经验,和一些php源码等。

    class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=347710' scrolling='no'> 近期系统常挂的情况。影响大家工作。针对此情况我们对系统进行了跟踪。发现系统的apache服务进程占用资源不断上升,导致系统假死。即使重启后,apache进程资源也不断自动增加。直到假死掉。
    在排除了代码问题后,我们查看了apache的日志,发现日志中的错误如下:
    [Thu Aug 25 11:00:56 2011] [notice] Apache/2.0.59 (Win32) PHP/5.2.5 configured -- resuming normal operations
    [Thu Aug 25 11:00:56 2011] [notice] Server built: Jul 27 2006 15:55:03
    [Thu Aug 25 11:00:56 2011] [notice] Parent: Created child process 4288
    PHP Warning:  PHP Startup: Unable to load dynamic library './php_mbstring.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0
    [Thu Aug 25 11:00:56 2011] [notice] Child 4288: Child process is running
    [Thu Aug 25 11:00:56 2011] [notice] Child 4288: Acquired the start mutex.
    [Thu Aug 25 11:00:56 2011] [notice] Child 4288: Starting 250 worker threads.
    经过错误日志看出。这是apache内存溢出。即确定为apache问题。
    在httpd-mpm.conf/httpd.conf 配置文件中,windows下apache加载的是“mpm_winnt_module”部分的配置信息。mpm_winnt_module中的参数ThreadsPerChild:每个子进程所产生的线程数,意思是系统启动时默认启动的等待线程数,用来等待处理客户的请求。MaxRequestsPerchild:每个子进程所处理的最大求情数。希望它在每次处理完请求后,kill掉进程,在重新创建,保持内存不会溢出。将MaxRequestsPerchild从默认的0(无限制)改10000以后,虽有所缓解,但仍然回假死。最后,在一片文章中偶然看见“ThreadLimit”这个参数的作用,ThreadLimit:线程数限制,参数值要和ThreadPerChild值一致。
    <IfModule mpm_winnt_module>
        ThreadsPerChild     300
        ThreadLimit      300           #这里ThreadLimit的值要与ThreadPerChild一致
        MaxRequestsPerChild    0
        Win32DisableAcceptEx        #这里禁用AcceptEx()函数
    </IfModule>

    设定以后apache没在假死。

    爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

    http://biancheng.dnbcw.info/php/347710.html pageNo:4
  • 相关阅读:
    DP 水题 最长不下降子序列
    数的划分
    水题------纪念品分组
    NY95 众数问题
    NY86 找球号(一)
    C3-Zexal的矩阵链乘
    C3-Zexal的多路流水线调度
    C4-Zexal的食物链
    C4-排列
    C3-炮弹杀伤力
  • 原文地址:https://www.cnblogs.com/ooooo/p/2240572.html
Copyright © 2011-2022 走看看