php / php/php-src

opcache crashes on high volume IIS servers (Windows)

Abierto
#12,010 12 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Bug OS: Windows Status: Needs Triage
Lenguaje dominante
C
Estrellas
40.4k
Forks
8.1k
Merge medio
2 d 13 h
PR fusionados (30 d)
96

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza reproduciendo el fallo bajo carga sostenida en IIS con Windows Server 2022 y PHP 8.0.28 o 8.0.29, comparando las configuraciones TS y NTS. Comprueba el informe de errores de Windows para php-cgi.exe y php_opcache.dll y, a continuación, compara el comportamiento con OPcache deshabilitado. Se considera terminado cuando se haya aislado la causa del fallo y la misma carga de trabajo ya no provoque el cierre de instancias de PHP.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
php
Área
backend, operating-systems, performance
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
20/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.