gpt4 book ai didi

php-fpm 在执行 uglifycss 时永远重生 child

转载 作者:太空宇宙 更新时间:2023-11-03 17:16:28 25 4
gpt4 key购买 nike

我在 php 应用程序中有这样一行:

exec('uglifycss 1.css 2.css > main.css');

执行后,php-fpm 开始不停地重启所有子节点,这导致服务器上的 cpu 在几秒钟内达到 100%。只有 service php-fpm restart 可以挽救这种情况。应用程序的所有其他部分都运行良好,并且与其他命令(uglifyjs、ssconvert、wkhtmltopdf)一起执行也运行良好,只有这一行会导致此类问题。

在 bash 中执行 uglifycss 效果很好,禁用 opcache 没有帮助,所有权限都是正确的,更改 uglifycss 版本没有帮助。该行本身运行良好 - 缩小文件出现在文件夹中。

PHP-FPM 日志:

[07-Jun-2017 00:10:39] NOTICE: fpm is running, pid 21162
[07-Jun-2017 00:10:39] NOTICE: ready to handle connections
[07-Jun-2017 00:10:39] NOTICE: systemd monitor interval set to 10000ms
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21199 exited with code 0 after 0.011741 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21200 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21200 exited with code 0 after 0.012848 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21201 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21201 exited with code 0 after 0.011070 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21202 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21202 exited with code 0 after 0.012875 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21203 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21203 exited with code 0 after 0.012139 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21204 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21204 exited with code 0 after 0.012334 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21205 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21205 exited with code 0 after 0.011729 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21206 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21206 exited with code 0 after 0.010936 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21207 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21207 exited with code 0 after 0.011194 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21208 started
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21208 exited with code 0 after 0.011382 seconds from start
[07-Jun-2017 00:10:59] NOTICE: [pool app] child 21209 started

依此类推,直到服务不会被手动重启...

服务器信息:

CentOS 7, php 7.1.5, node 8.0.0, npm 5.0.0, uglifycss 0.0.27

好像是个bug,有没有人遇到同样的问题?有什么解决办法吗?

最佳答案

这是一个与在子进程中使用 exec/passthru 有关的 php-fpm 错误。这是由于对标准输入的争用。修复可以在这个 PR 中看到:https://github.com/php/php-src/pull/3287已合并到 php 7.1 中。

关于php-fpm 在执行 uglifycss 时永远重生 child ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44400072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com