Edit report at https://bugs.php.net/bug.php?id=76280&edit=1
ID: 76280
Updated by: nikic@php.net
Reported by: teo8976 at gmail dot com
Summary: Performance degrades permantly when overwriting PHP
files, until apache restart
-Status: Open
+Status: Feedback
Type: Bug
Package: opcache
Operating System: debian
PHP Version: 5.6.36
Block user comment: N
Private report: N
New Comment:
Please check whether the deployment of new files triggered an opcache restart (because the opcache
SHM memory limit was reached). Generally any slowdown should only be temporary though.
In any case, PHP 5 is no longer supported and PHP 7 has quite a lot of changes to improve
performance, including in opcache. Additionally, the second-level file cache can be used to reduce
the performance impact of opcache restarts.
Previous Comments:
------------------------------------------------------------------------
[2018-04-27 19:18:44] teo8976 at gmail dot com
Here's some example performance data (oh come on, I can't attach a screenshot??) https://ibb.co/h3J6bx
This is avarage execution time (measured on the server side) of all requests, but graphs for any
given single url would show exactly the same pattern.
------------------------------------------------------------------------
[2018-04-27 19:09:56] teo8976 at gmail dot com
Description:
------------
I have a website (well, it's not mine actually) that gets about 1k requests per minute.
Sometimes I upload updated PHP files. Obviously this means I'm overwriting files at the very
same time they are being executed. I expect that to cause errors (experienced by the users) during
the short period of time while files are being overwritten (usually a few seconds).
However, what I wouldn't expect and happens VERY often is that: after that, general performance
degrades, meaning that the execution of EVERY SINGLE script in every single request is significantly
slower. Sometimes it's just a few dozens % increase in execution time, sometimes it explodes to
the point that the whole websites goes down.
Restarting apache returns performance to normal every time, whether there had been a total collapse
or just a degradation in performance.
Expected result:
----------------
When you overwrite PHP files in a website that is being visited by thousands of people, you'd
expect a small percentage of them to experience random errors, if a file is being overwritten just
when it's being executing.
However, as soon as all the requests that were being handled are done, everything should go back to
working normally, and there shoul be no need to restart Apache
Actual result:
--------------
See description.
Seriously, this is fucking pathetic.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76280&edit=1