Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108243 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92416 invoked from network); 25 Jan 2020 18:22:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jan 2020 18:22:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D9E851804E6 for ; Sat, 25 Jan 2020 08:32:11 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 ; Sat, 25 Jan 2020 08:32:11 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id t14so2499937wmi.5 for ; Sat, 25 Jan 2020 08:32:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=0/6CmcCLNemPKWDLnCX0Ic6ssxoIwyT8RZBlMP3Eqsw=; b=cIZLwpAZtidUJotU/GCkhwoV+SWTxuxyoST7Lqh6y/Zz25aXQQ8gWaTB20Rgoqbd76 jWE8AtITl/16qrA46ceDmXYcCjbP+6fLUfE0lbBvLdBIBFQ20+5Sd0k2aIPxzCF//2Ns lRB1kW4NvNjLMLgljhtiYW5L3wci+MN/F4280395kex8QIIGC8IALWTWbYAtUwvn0EA7 KZk7g5V8rdjjyoMEreZX3r/QYtVYgTke3X3BSwlZHTjYSndN286MWONFoC7eaB/1VYvB IWLr1bCsYJ0dBEzkZhZ70jueo7uA+VAabcL20vBRzQu7y3A8j4uAZbF5tKTPcgBSkiar NaZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=0/6CmcCLNemPKWDLnCX0Ic6ssxoIwyT8RZBlMP3Eqsw=; b=eMAeyUjx6zCjjKIsnXW/n4jqO6AUEUG6hRHZYwXejmhMw34ihEjazYZkMRr5yneGGK i8qXTR/0/9SwjCm/2i7h5FsLSU7zYyyPUOapHnSMXiN4DUHZRLQV94cDMC6gXW66dRnD PtHhsax5J0eKR3ZVvbSafk7cUr0sFlSpunH9jaI5pzoRdpjdBJKYPwPjymGGU5g5Ei9k vs/AkIB3BVqJlRQ4t5JR5KJONjnrP0bRapA0RIkMvoIAF06ABIsHhIRN8ZpbvNZ9zYmY OIjxR1p1Slsc5/ACtwpcsnn/FkQt6iNGXIn6UeXWpOIMebS67M3w3rWbLevizhCRirz8 3ntw== X-Gm-Message-State: APjAAAX4+K14mbGrWs5NZynA/E+VLe9YBJgOIdcI0Xgd/w7KSfInbZMH XD3lGzWyv04ExVrWHrj07CNnq8XN X-Google-Smtp-Source: APXvYqxzAizMAxCGCgMJiHOnPFt0vXjjBz0WPcA0+qnC1HHZzzSC9tNxa5T6lS9vdWMWoT4q7YCEVA== X-Received: by 2002:a05:600c:2c01:: with SMTP id q1mr4839534wmg.179.1579969926020; Sat, 25 Jan 2020 08:32:06 -0800 (PST) Received: from [192.168.0.14] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id f1sm12405027wrp.93.2020.01.25.08.32.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Jan 2020 08:32:05 -0800 (PST) To: internals@lists.php.net References: Message-ID: <3ca6d665-1a4f-8f7a-c82a-2e899f2e8df1@gmail.com> Date: Sat, 25 Jan 2020 16:32:04 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] Add viable long running execution model to php 8 From: rowan.collins@gmail.com (Rowan Tommins) On 24/01/2020 09:29, Robert Hickman wrote: > PHP is pretty unusual in comparison to most web platforms nowadays as it > runs each request in an isolated process. Web development in other > languages is instead based around a long lived set of processes, which > serve multiple requests. > > That model has advantages in that it is very easy to cache data in process, > and should be simpler in theory to get good performance as all code can be > loaded into memory once during startup. Autoloading therefore goes away. Hi Robert, Could you share some more thoughts on what you are thinking of here? I'm guessing you're thinking along the lines of an "event-based" system, where each request is a function call, rather than a whole script invocation? PHP is sometimes described as having a "shared nothing" architecture - everything is wiped out at the end of each requests - so perhaps one way to look at this is to propose a "shared something" version. The first question is _what_ we want to share. We already have sharing of compiled code, with OpCache bundled since 5.5, and the pre-loading feature in 7.4 could make autoloading redundant for many applications. What we can't share natively is any data structures, resources like database connections, or other global state like set_error_handler. The second question is _how_ it should be shared - what would it look like to the user? For instance, should _simultaneous_ requests be able to share state? That might mean making them explicitly aware of other threads, or running them all on one thread but in a series of asynchronous functions (as I understand it, that's how node.js works). It's definitely an interesting question to explore, though. Regards, -- Rowan Tommins (né Collins) [IMSoP]