php / php/php-src

opcache crashes on high volume IIS servers (Windows)

未关闭
#12,010 12 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug OS: Windows Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

There is no way to reproduce the bug with code.
The sneakiest thing is that everything works as it should, but opcache fails when the server load increases beyond a certain threshold.
I assume, but of course I'm not sure, because of the shared memory. This assumption derives from the fact that when it happens all the PHP (cgi) instances close unexpectedly (opcache's shared memory should be the only thing connecting them). I also tried to change the opcache memory model, but nothing changes.
Furthermore, in 99% of the cases no error is visible on the Windows events, but obviously on the IIS user side it shows a 500 error.

The only way I've found to reproduce the bug is to overload a test server (with the same configuration as the production server), after some time (usually a few minutes), all PHP instances close and occasionally I see an error similar to this:

Faulting application name: php-cgi.exe, version: 8.0.28.0, time stamp: 0x63eb7b04
Faulting module name: php_opcache.dll, version: 8.0.28.0, time stamp: 0x63eb7e4f
Exception code: 0xc0000005
Fault offset: 0x0000000000168011
Faulting process id: 0x1f2c
Faulting application start time: 0x01d9d3b2249e086e
Faulting application path: /path/to/php-cgi.exe
Faulting module path: /path/to/php_opcache.dll
Report Id: de8f6365-8a29-4f20-b3cf-d2d160d39508
Faulting package full name: 
Faulting package-relative application ID: 

I got proof that the cause is linked to opcache overloading the same server after disabling opcache. The server becomes (obviously) very slow, but no PHP instances crash even after 1 hour.

PHP Version

Both TS and NTS, PHP 8.0.28 + PHP 8.0.29 + (PHP 8.0.?)

Operating System

Windows Server 2022 Datacenter

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在运行 Windows Server 2022 和 PHP 8.0.28 或 8.0.29 的 IIS 上,在持续负载下重现崩溃,并比较 TS 和 NTS 配置。检查 Windows 中针对 php-cgi.exe 和 php_opcache.dll 的故障报告,然后比较禁用 OPcache 时的行为。当故障原因已被隔离,且相同的工作负载不再导致 PHP 实例崩溃时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
backend, operating-systems, performance
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。