Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102067 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36913 invoked from network); 20 Apr 2018 13:01:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2018 13:01:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 104.47.33.138 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.33.138 mail-bn3nam01on0138.outbound.protection.outlook.com Received: from [104.47.33.138] ([104.47.33.138:12288] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/27-38944-694E9DA5 for ; Fri, 20 Apr 2018 09:01:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LSCtQ6oqlafSdYDIacwmisq5n/p5TAnfu7xH8I5z6GU=; b=Bv/+jMhRPtaOd/s8BDIosEmSg1uRIgY4zXW1s0lDM8p4XysdOKLTgDEMAUVuuoz8nunTjn7NvYKF/RYzPCl4QHg8QlSdNHH3EZ5keKfV7Q9IQh51JST0hh05RrMivtVJ+9q0O4mcOOjMig79FYn58y4NM2KM4vhGS26uwtyu/nQ= Received: from BN6PR02MB3234.namprd02.prod.outlook.com (10.161.152.32) by BN6PR02MB2292.namprd02.prod.outlook.com (10.168.253.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.696.12; Fri, 20 Apr 2018 13:01:06 +0000 Received: from BN6PR02MB3234.namprd02.prod.outlook.com ([fe80::b5e1:42c:d6ad:56c]) by BN6PR02MB3234.namprd02.prod.outlook.com ([fe80::b5e1:42c:d6ad:56c%13]) with mapi id 15.20.0696.013; Fri, 20 Apr 2018 13:01:06 +0000 To: Jakub Zelenka CC: PHP internals list Thread-Topic: FPM preloading of PHP files Thread-Index: AQHT1lerlsdxF46zs0KR37j9XO6GYqQFJc4FgAGgEICAAoXNrYAAJXWAgAAw9+Q= Date: Fri, 20 Apr 2018 13:01:06 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: php.net; dkim=none (message not signed) header.d=none;php.net; dmarc=none action=none header.from=zend.com; x-originating-ip: [212.232.72.197] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR02MB2292;7:XLem6cOtv+xfi7pyiHqW8JTbHd48thow1RkPXRypLxnOxfd9WOxjYzZQ7xC6ZCSY5VqtgoHnFGL/f7zfhgsbT6CrUl08KpNrXFgolfhyZFMo1apFGBZI704z7T7MpKZmUZvlYbeQHTgVY6nBmH3PAMVvL/dQNf1/9MK3/gObQGCWCPZntOHFXKqxyNDhKt04Jq5UzeNB8i7vZmr7fiaEzBm1K5CIgdWVTlnBvhDeLGpLoL20QbbKQ7XNtM81oGwU x-ms-exchange-antispam-srfa-diagnostics: SOS; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BN6PR02MB2292; x-ms-traffictypediagnostic: BN6PR02MB2292: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(20558992708506)(192374486261705)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231232)(944501394)(52105095)(93006095)(93001095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011);SRVR:BN6PR02MB2292;BCL:0;PCL:0;RULEID:;SRVR:BN6PR02MB2292; x-forefront-prvs: 0648FCFFA8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39850400004)(376002)(39380400002)(346002)(396003)(51444003)(86362001)(25786009)(236005)(9686003)(53936002)(186003)(76176011)(16799955002)(7696005)(8936002)(81166006)(6246003)(2900100001)(93886005)(8676002)(316002)(4326008)(6916009)(55016002)(6436002)(66066001)(74316002)(476003)(33656002)(19627405001)(3846002)(446003)(11346002)(102836004)(5660300001)(53546011)(6606003)(229853002)(6506007)(478600001)(7736002)(5250100002)(59450400001)(3660700001)(3280700002)(2906002)(26005)(54896002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR02MB2292;H:BN6PR02MB3234.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;MLV:sfv; x-microsoft-antispam-message-info: Lx5PUwMNNWu9YufOJZyw+LOJVUQxH/GHnVvM3K/onOh4Fw+zdQ0YEcjRYSNVaOLl5g46cIEsv2vgaCcAz5elLKxAOp68G259q0kqVIK3V/3RQYS1gEEdLtqSyCcENcPbHetFw/xDdyUAjHPj0I0tkcisuiKDup169rk9+ZleSk/h5Zd5/LIbEGOk+/nadbNU spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BN6PR02MB32341533F88DE19D56FC2AD9BFB40BN6PR02MB3234namp_" MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c12fc84f-d3ec-487f-4a59-08d5a6bec7d1 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-Network-Message-Id: c12fc84f-d3ec-487f-4a59-08d5a6bec7d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2018 13:01:06.8547 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2292 Subject: Re: FPM preloading of PHP files From: dmitry@zend.com (Dmitry Stogov) --_000_BN6PR02MB32341533F88DE19D56FC2AD9BFB40BN6PR02MB3234namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This makes sense. ________________________________ From: jakub.php@gmail.com on behalf of Jakub Zelenka = 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 > 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 proble= matic. 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 probl= em is that many (probably most) configurations have master running as a roo= t and a worker process uses setuid and setgid to set a different user and g= roup 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 applic= ation (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 cou= ld have some security implications. That's why I think it would be better t= o do preloading in a pool manager process that I described before (basicall= y a process with the pool configured user and group that would spawn worker= s). Cheers Jakub --_000_BN6PR02MB32341533F88DE19D56FC2AD9BFB40BN6PR02MB3234namp_--