Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122043 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14198 invoked from network); 26 Dec 2023 00:41:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Dec 2023 00:41:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D942E18004E for ; Mon, 25 Dec 2023 16:42:13 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DMARC_MISSING, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 25 Dec 2023 16:42:13 -0800 (PST) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a2335d81693so700615066b.0 for ; Mon, 25 Dec 2023 16:41:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703551307; x=1704156107; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i8KTeI7RiqNKWXzhc2bGl3UIKzGXDcG5/lNtn1hDqm4=; b=GapTbr9yJZynb26Qw8b1RfRj8OM9zZUuQ4ypynAzDP9NTLRfCXB1aGG6jHDGvTWsmk MGujV5tuXJvw+FgWSPAIYgveTBbBx7CT4QsJvWjVdR2EOuJnUmNhna2RIWQzNcgmSkVJ /+eGkAN1oTiFLXBK5AIPOLo1ARNQauQjXjjiF8x4l2a0xp7Q01dOQDlyNHfS2yIM7cEe +qMa4YLTZjNiHiy/M7TBeMP+xqcmpLiX0hfz/RVTTsCyBAQEwyKD0i4DPgjsK0f9EvT0 IqD9HwC5C7gQO7418AR/eUPHA0HSLgqVQIvntyHVB12Lol8UCej9bi8FJD6XtwlwUVUr wotQ== X-Gm-Message-State: AOJu0YwqM06NSANpgN4Es0qDViSg6m2d2eK8IfHNubnyqQqrDzZcNjJu sAxqeJoynneSHt/00/+W8jN7wYn7Pc0QJDwFgRg= X-Google-Smtp-Source: AGHT+IFBpPbTi9tyzYY7UM+RAdgucYj3eGpkrJbPviJMjDdjTq09MO6jRREDshy2zz5NQzaf1uZw6b/NSxRMZdaH2zo= X-Received: by 2002:a17:907:1b09:b0:a26:cdae:e295 with SMTP id mp9-20020a1709071b0900b00a26cdaee295mr5650327ejc.74.1703551306706; Mon, 25 Dec 2023 16:41:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 26 Dec 2023 00:41:35 +0000 Message-ID: To: Robert Landers Cc: =?UTF-8?Q?K=C3=A9vin_Dunglas?= , Larry Garfield , php internals Content-Type: multipart/alternative; boundary="0000000000007e30e8060d5ef213" Subject: Re: [PHP-DEV] RFC proposal: worker mode primitives for SAPIs From: bukka@php.net (Jakub Zelenka) --0000000000007e30e8060d5ef213 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Dec 26, 2023 at 12:09=E2=80=AFAM Robert Landers wrote: > Hi Jakub, > > > I have been thinking about something similar for FPM and if you had som= e > > sort pool manager process, you could maybe do some sort of initial > > execution but then it gets really tricky especially with sharing > resources > > and managing connections. I think it would be a big can of worms so I > don't > > think this is going to happen anytime soon. > > It's already happening. Most libraries (particularly popular ones in > the Symfony/Laravel world) already support most of this > out-of-the-box. I love stateless servers, but sometimes a stateful > server is better. What is really nice about worker mode is that you > can actually have a PHP-native in-memory database that only exists for > as long as the worker is running (I do this for some unit tests). > > This was just about FPM. What I meant that this is not going to be supported by FPM anytime soon if ever. > > I could imaging that there will > > be similar issues for Apache prefork which is likely the most used MPM > for > > legacy apps. Effectively it means that this function won't be working o= n > > most installations as two of the likely most used SAPI's won't support > it. > > I think it should be pretty clear from the beginning. > > Most people are familiar with fastcgi_finish_request() and there are > some built-in SAPI's that don't support it. I don't think that just > because it won't start out with full support, it should be discarded. > > I didn't mean that it shouldn't be added. It should just be clear from the beginning that this will be for limited set of SAPIs. > > It would be also good to put together some base design PR for this as > > currently SAPI common functions are implemented separately in each SAPI > > (e.g. apache_request_headers). From the linked functionality, it is is > not > > a big amount of code and seems somehow specific to the FrankenPHP so wh= y > > couldn't each SAPI just implement this function separately? I know that > > this is not ideal but it's what is already used for > apache_request_headers. > > I think otherwise you would need some hooking mechanism that should hav= e > > some default (which would probably just throw exception) because it is > not > > going to be implemented by all SAPI's. I think it would be really good = if > > you could provide more details about planned implementation for this. > > Most (all?) modern SAPI (lightspeed, roadrunner, etc) implements > fastcgi_finish_request(), even if no fastcgi is involved, simply > because of backward compatibility. It'd be great to actually bikeshed > a decent name and syntax/semantics before something popular comes > along and forces us all to use frankenphp_handle_request() or > something, simply because of backward compatibility. > I agree that coming up with some sensible name and API would be a good think even though it will have limited use in core. And if it gives us some coverage of embed SAPI (libphp), then it's even better. Cheers Jakub --0000000000007e30e8060d5ef213--