Hi Jakub,
I thought about pre-loading explicitly specified files (or directories) on PHP startup, before forking worker processes. As result all pre-loadd files should be available to all workers. Of course the should be kept in immutable form. Thanks. Dmitry. ________________________________ From: jakub....@gmail.com <jakub....@gmail.com> on behalf of Jakub Zelenka <bu...@php.net> Sent: Wednesday, April 18, 2018 8:18:33 PM To: Dmitry Stogov Cc: PHP internals list Subject: Re: FPM preloading of PHP files Hi Dmitry On Tue, Apr 17, 2018 at 5:44 PM, Dmitry Stogov <dmi...@zend.com<mailto:dmi...@zend.com>> wrote: Hi Jakub, I though not only about FPM, but a technology for any SAPI. Pre-loaded classes and functions might be kept in CG() tables, in the same way as "internal" ones. EG() constants and variables may be re-created at start of request, executing pre-loaded PHP code. Few years ago, I developed something similar for PHP-5. Yeah that's what I kind of meant by the engine support. :) My idea was more about when it should be preloaded. For example one option would be to preload it automatically if nothing has been preloaded as part of php_execute_script / zend_execute_script. However that would mean to do it for each child (basically use it for all request for the child process life). It should work and might be a viable options for the initial implementation but more optimal would be do it once for all children running in the same pool which could be doable using the pool managers. I think it would be great to have some kind of API so the SAPI can explicitly preload the script. Cheers Jakub