Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114013 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51895 invoked from network); 9 Apr 2021 21:16:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Apr 2021 21:16:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A2733180507 for ; Fri, 9 Apr 2021 14:16:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com [209.85.222.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 9 Apr 2021 14:16:11 -0700 (PDT) Received: by mail-ua1-f44.google.com with SMTP id 33so2255963uaa.7 for ; Fri, 09 Apr 2021 14:16:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EroKyy2AFD/TlLqFTCrgIxEeXWbb3zilCBmmz8M1BIQ=; b=iZsj/EKC8Rklj4Y8SPdY1/CfCIaSzYWozapnf84M09I7wHW2tO8SJKRPe+egsiOwvI bH5XfwCyoCja1VZ9xzFD2VAE1erCpxCa9a7/X3U4D4mMM1zw1m9OjCo463B7/HHZ6k1m XDa9YQnP9eXU0vnplcgYrm1gQVfDPa9gSAlL0/UnEqqfM47QpOAoq+YiUYvFlS5atItV XN3EN/i04K+s/N02ih+TmDPOSzyCDnbSabl5h7Sq6/lo5VFIPk68Dd9XDouKs2dBB98G R1WBWKFDaA9iGcuZ5htvWrwfr6OtGxkIafn5MC2Y9/Zv4JJcwmv/yM/0teieFTgdkpZJ leRg== X-Gm-Message-State: AOAM531z7uJtrETKi2yb5FulmaKbTMfvT9j7aiRC0swzKakS0gWt4woN oqEkDwoQGyBv8qmXy+LtlH2uR9nPQXXkfzX2K3c= X-Google-Smtp-Source: ABdhPJwtjaUfXySfW8cfSLSFHqbvzOVta01cUIjrpPrXTO3dXxcWurANX0R5V+GNmC2V8f3N6ZsY9G2WiL1kaW3AGQY= X-Received: by 2002:ab0:60ae:: with SMTP id f14mr3342303uam.114.1618002967262; Fri, 09 Apr 2021 14:16:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 9 Apr 2021 22:15:56 +0100 Message-ID: To: Mohammad Eftekhari Cc: PHP internals list Content-Type: multipart/alternative; boundary="0000000000001bf80f05bf90ac2e" Subject: Re: [PHP-DEV] FPM: Three-Phase running idea for faster frameworks From: bukka@php.net (Jakub Zelenka) --0000000000001bf80f05bf90ac2e Content-Type: text/plain; charset="UTF-8" Hi, On Fri, Apr 9, 2021 at 5:48 PM Mohammad Eftekhari wrote: > Hi and thanks for the latest great features. > > > Idea visualized: > > https://drive.google.com/file/d/1twuCTk2ssNl5damTydP-aOmOeJ5hWr9r/view?usp=sharing > > This is an idea and it's simple on the paper: *To run the requests coming > to PHP Frameworks in three phases. * > > > Let's say FPM pool child processes can run PHP instances in two-phase: > > > - > > Initialization Phase: It runs an instance of our PHP code with no > request information given. The running PHP code is interrupted by some > kind > of input mechanism which is put deliberately by the developer into the > code. FPM will keep this process on RAM waiting for a request to come > in. > This is basically what was drafted in https://github.com/php/php-src/pull/6772 . I would recommend you to read that PR discussion for details. To sum it up, the tricky part is the implementation as it has to work with all PM's and reload. Most likely we will need to introduce event (epoll on Linux) based loop in the child accepting to be able to properly clean it up. In addition a new request stage will be likely needed and then sorting all the possible edge cases out. Regards Jakub --0000000000001bf80f05bf90ac2e--