#990 introduced a rotatePHPRuntime function that swaps the internal PHP runtime for a fresh one after a certain number of requests are handled. This is necessary because PHP has a memory leak and exhaust the HEAP space eventually.
Ideally the rotation logic would be based on the amount of free, unfragmented memory.
The challenge there is to find a fast method of keeping track of that – even a naive approach of calculating the null bytes takes a few blocking seconds.
cc @sejas
#990 introduced a
rotatePHPRuntimefunction that swaps the internal PHP runtime for a fresh one after a certain number of requests are handled. This is necessary because PHP has a memory leak and exhaust the HEAP space eventually.Ideally the rotation logic would be based on the amount of free, unfragmented memory.
The challenge there is to find a fast method of keeping track of that – even a naive approach of calculating the null bytes takes a few blocking seconds.
cc @sejas