微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

apache2服务器中的零空闲工作程序导致性能问题

如何解决apache2服务器中的零空闲工作程序导致性能问题

我有一个基于apache2和MysqLPHP构建的SAAS产品,它已托管在AWS上。 我的生产在高峰时间非常慢,当我检查服务器状态时,它说闲置的工人为0(零) 我正在使用mpm-prefork

Current Time: Monday,24-Aug-2020 19:36:32 UTC
Restart Time: Friday,14-Aug-2020 06:03:27 UTC
Parent Server Config. Generation: 12
Parent Server MPM Generation: 11
Server uptime: 10 days 13 hours 33 minutes 5 seconds
Server load: 1.17 1.07 0.95
Total accesses: 28851443 - Total Traffic: 824.8 GB
cpu Usage: u289.99 s50.68 cu0 cs0 - .0373% cpu load
31.6 requests/sec - 0.9 MB/second - 30.0 kB/request
256 requests currently being processed,0 idle workers

以下是我的mpm-prefork.conf设置文件

<IfModule mpm_prefork_module>
        StartServers                     5
        MinSpareServers           5
        MaxSpareServers          10
        MaxRequestWorkers         450
        MaxConnectionsPerChild   0
</IfModule>

ubuntu20.04上的TOP命令给了我这个

top - 20:03:58 up 143 days,11:16,1 user,load average: 0.48,0.71,0.83
Tasks: 369 total,3 running,317 sleeping,0 stopped,0 zombie
%cpu(s): 15.9 us,3.2 sy,0.0 ni,79.9 id,0.0 wa,0.0 hi,1.0 si,0.0 st
KiB Mem :  7865072 total,1023492 free,2752320 used,4089260 buff/cache
KiB Swap:        0 total,0 free,0 used.  4755856 avail Mem

根据详细信息,我可以看到1 GB的ram仍然可用。那么零闲置工人是谁? 同样,为什么当我将MaxRequestWorkers设置为450时零个空闲工作者仅处理256个请求。计算机中的最大RAM是8GB

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。