Hi, On Fri, Apr 9, 2021 at 5:48 PM Mohammad Eftekhari <[email protected]> wrote:
> Hi and thanks for the latest great features. > > > Idea visualized: > > https://drive.google.com/file/d/1twuCTk2ssNl5damTydP-aOmOeJ5hWr9r/view?usp=sharing > > This is an idea and it's simple on the paper: *To run the requests coming > to PHP Frameworks in three phases. * > > > Let's say FPM pool child processes can run PHP instances in two-phase: > > > - > > Initialization Phase: It runs an instance of our PHP code with no > request information given. The running PHP code is interrupted by some > kind > of input mechanism which is put deliberately by the developer into the > code. FPM will keep this process on RAM waiting for a request to come > in. > This is basically what was drafted in https://github.com/php/php-src/pull/6772 . I would recommend you to read that PR discussion for details. To sum it up, the tricky part is the implementation as it has to work with all PM's and reload. Most likely we will need to introduce event (epoll on Linux) based loop in the child accepting to be able to properly clean it up. In addition a new request stage will be likely needed and then sorting all the possible edge cases out. Regards Jakub
