php - Apache 低空闲工作人员但不是最大请求

标签 php apache centos

我有 apache 的默认最大工作人员,禁用连接重用非常低的内存和 CPU 利用率和负载,低 IO 延迟,但我的空闲工作人员似乎非常低。有时接近或接近 0 并且根本不稳定,它一吨高一低。我用很少的元素提供一个基本的 php 登录页面。

在我看来数学应该是

idle workers=256-(requests currently being processed)

但事实并非如此。 Apache 记分牌显示(如果我在正确的时间捕获它):

121 requests currently being processed, 10 idle workers

CRCCCCCCCCCCCCCCCCCCCCRCCCRCCCRCCCCRCWCWCCCCCCCCCCCRCCRCCCCRRCRC
CCCCCCCRCCCCCCRCCCCCCCCCCCCCCWR_CCCC_CCCCCCCRCCCRCCCCCCCCC.CCC..
RCCC.C.C.....R.................C.......C........................
C........C...C..........CR....C.C.....R...........C....C.R..C.R.

在我看来,“.”也是如此。表示空闲的 worker 。我错过了什么?我想确保没有 0 个空闲 worker 的微爆发影响我的服务。

最佳答案

https://www.liquidweb.com/kb/apache-performance-tuning-mpm-directives/#prefork

MinSpareServers

This directive defines a minimum number of spare children the Apache parent process can maintain in its memory. An additional server is a preforked idle Apache child that is ready to respond to a new incoming request. Having idle children waiting for new requests is essential for providing the fastest server response times. When the total idle children on the server drop below this value, a new child is preforked at the rate of one per second until this directive is satisfied. The “one per second” rule is in place to prevent surges of the creation process that overload the server, however, this failsafe comes at a cost. The one per second spawn rate is particularly slow when it comes to handling page requests. So it’s highly beneficial to make sure enough children are preforked and ready to handle incoming requests.

关于php - Apache 低空闲工作人员但不是最大请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59163031/

相关文章:

php - 只显示mysql中IN子句中指定的id

php - 从 mysql 表加载图像

php - 用于包装数据库行子类的 OOP 方法

apache - Hadoop 文件系统复制 - 名称节点与数据节点

linux - 如何修复未在 CENTOS 上构建的 802.11 Linux STA broadcom 驱动程序?

php - 字母ő。哪种 PHP 编码/解码效果最好?

php - 自定义错误页面Intranet子域

apache - 无法启用 php display_errors

server -/bin/python : No module named typing; 'pip' is a package and cannot be directly executed

linux - 如何在 CentOS 最小安装中的 awk 中使用多个字段分隔符