This makes sense.
________________________________ From: jakub....@gmail.com <jakub....@gmail.com> on behalf of Jakub Zelenka <bu...@php.net> Sent: Friday, April 20, 2018 1:04:01 PM To: Dmitry Stogov Cc: PHP internals list Subject: Re: FPM preloading of PHP files Hi Dmitry, On Fri, Apr 20, 2018 at 8:54 AM, Dmitry Stogov <dmi...@zend.com<mailto:dmi...@zend.com>> wrote: 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. This is actually the reason why I'm thinking about the pool manager process in this context. The current FPM architecture would make this quite problematic. Currently the process that would have to preload the file would be a master process because it's the one that forks worker processes. The problem is that many (probably most) configurations have master running as a root and a worker process uses setuid and setgid to set a different user and group after the fork. I think that would be a source of many bug reports if the resources created during preloading could not be accessed by the application (worker executed files) because the permission issue. Also it wouldn't be probably a good idea to give a root access to the preloading as it could have some security implications. That's why I think it would be better to do preloading in a pool manager process that I described before (basically a process with the pool configured user and group that would spawn workers). Cheers Jakub