Repository navigation
Commit 47f7b00
Activate OPcache in the restarted process and fork workers under it
ForkParallelChecker now blocks fork only on JIT. Concurrent population
of plain OPcache's shared memory from forked children is php-fpm's
normal operating model (writes go through the allocator lock, readers
are lock-free), and the mid-request fork cannot hold that lock or ever
execute a cache restart — only JIT's shared code buffer is fork-unsafe.
TurboProcessRestarter piggybacks -d opcache.enable=1 + enable_cli=1
onto the exec it pays for anyway: optimized opcodes, the inheritance
cache, and forked workers inheriting the parent's warm SHM instead of
each compiling lazily-loaded classes for itself.
JIT is pinned off via both opcache.jit=disable and jit_buffer_size=0 —
one directive alone leaks on one generation of defaults (<= 8.3
defaults jit=tracing, so an ini with a web-tuned buffer size would JIT;
>= 8.4 defaults the buffer to 64M, so an ini setting just opcache.jit
would). It is stripped even when the ini enables it deliberately — a
measured slowdown for PHPStan that would also force spawned workers —
the same treatment the xdebug-handler restart gives xdebug. When
OPcache is not loaded (possible only on <= 8.4; since 8.5 it is always
built in) nothing is added: -d zend_extension= would only emit startup
warnings.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ek2A83bWb3Yf4CRmtvBfi41 parent ab63c95 commit 47f7b00
2 files changed
Lines changed: 57 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
| |||
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
106 | 158 | | |
0 commit comments