Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102064 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21672 invoked from network); 20 Apr 2018 07:54:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2018 07:54:24 -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.37.97 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.37.97 mail-cys01nam02on0097.outbound.protection.outlook.com Received: from [104.47.37.97] ([104.47.37.97:51808] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/65-38944-EAC99DA5 for ; Fri, 20 Apr 2018 03:54:22 -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=NF8BVvTytzW5hu9Xx1uKvOyss9krSoeE4ne33knTwcM=; b=lXWbGdFfTgFtg2uCSVfY26XQHe2IzIpCq0Dr/snm9UyZN6qyXanqWofZt+YMnRWuBQjfxMcVIfQWCYleM/IGRlGxvK7mq4I4tPjRQ9HqWxD9FB3RBLACZo96bYhG7CulXt+iCRFrScHOrJDRL41iEV09dBXCODIstidPvK3qIGs= Received: from BN6PR02MB3234.namprd02.prod.outlook.com (10.161.152.32) by BN6PR02MB3281.namprd02.prod.outlook.com (10.161.152.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.696.13; Fri, 20 Apr 2018 07:54:17 +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 07:54:17 +0000 To: Jakub Zelenka CC: PHP internals list Thread-Topic: FPM preloading of PHP files Thread-Index: AQHT1lerlsdxF46zs0KR37j9XO6GYqQFJc4FgAGgEICAAoXNrQ== Date: Fri, 20 Apr 2018 07:54:17 +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;BN6PR02MB3281;7:p+DwOeGwBmCZEufiJ/dnjxSO7werttHZE6uKhPqSMGxD1V1hWi1u4cnGzHhsP1Z7gxXgvi+gkN+8Khx3yANa/RwLbOKfcUOVvLPDjZ7dYwKmSIXN0whvivVyapaMQXYobI2WiLdvgRnjprSAiyh1WIhfH3zCO26TXBH4YRNq/YN8YaZ+Iqbqu/HXGGMBYYoPkoe2QWyPg2crb5rH8Gi8O364Jg8UgaPz1Pz3psIbnpaVf/q2+j1EdI6TL2iuut3G 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:BN6PR02MB3281; x-ms-traffictypediagnostic: BN6PR02MB3281: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231232)(944501391)(52105095)(10201501046)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:BN6PR02MB3281;BCL:0;PCL:0;RULEID:;SRVR:BN6PR02MB3281; x-forefront-prvs: 0648FCFFA8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(346002)(396003)(39380400002)(39840400004)(3280700002)(54896002)(478600001)(6436002)(3660700001)(76176011)(2906002)(66066001)(8936002)(19627405001)(81166006)(8676002)(55016002)(7736002)(9686003)(446003)(4326008)(476003)(53546011)(5250100002)(102836004)(6506007)(236005)(86362001)(26005)(7696005)(11346002)(59450400001)(6246003)(316002)(186003)(5660300001)(53936002)(16799955002)(33656002)(6916009)(2900100001)(6606003)(229853002)(6116002)(25786009)(3846002)(74316002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR02MB3281;H:BN6PR02MB3234.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;MLV:sfv; x-microsoft-antispam-message-info: RnayIPFvl31yxuOAO8pJ2heJBKsraHwTbpU33/GZsVq5PG/ibqx+3wZHAokek45ABatRF3CFsHC89YryvzbWBAsJte3ant0Mv+s0exWObZyRsjKVGmQ5aHddYlC36tGIGR1RZcp+LCAms5mZScrEiSHW5WXNNCFR/tEeWGdxu6LuvfmlsRNRJqifTzFfVB4y spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BN6PR02MB323426F49DD42972F661DA8ABFB40BN6PR02MB3234namp_" MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f9ce584b-e6f3-4473-dc85-08d5a693eac8 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9ce584b-e6f3-4473-dc85-08d5a693eac8 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2018 07:54:17.0822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3281 Subject: Re: FPM preloading of PHP files From: dmitry@zend.com (Dmitry Stogov) --_000_BN6PR02MB323426F49DD42972F661DA8ABFB40BN6PR02MB3234namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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.php@gmail.com on behalf of Jakub Zelenka = 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 > 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, executi= ng 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 prel= oad it automatically if nothing has been preloaded as part of php_execute_s= cript / zend_execute_script. However that would mean to do it for each chil= d (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 --_000_BN6PR02MB323426F49DD42972F661DA8ABFB40BN6PR02MB3234namp_--