Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112489 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 46314 invoked from network); 11 Dec 2020 11:28:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Dec 2020 11:28:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 512321804C4 for ; Fri, 11 Dec 2020 02:58:28 -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=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, 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 mout.gmx.net (mout.gmx.net [212.227.15.18]) (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, 11 Dec 2020 02:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607684303; bh=xopJ0NPtA8RmPtfoPWfC4USGp3Ky6auTSScqsE612uo=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=DA+QyB/cOfkxpVIiRSPtjA3vAQ7jdmEpSqjuR0Ua2Fazmj+K9JGkmEmhcwL1HPqe2 eUD9vwoA3BIErxxxkjeTotDa+NQuJtbU2zj+oM5HEjmvFRmPbLV6A48NKzt56FVMeo PwUN+ILbOK7dmQCuyikTbvS5XRXRg+5C956teV4w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.120] ([24.134.51.41]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N7i8O-1k0oqS46nS-014oqK for ; Fri, 11 Dec 2020 11:58:23 +0100 To: internals@lists.php.net References: Message-ID: Date: Fri, 11 Dec 2020 11:58:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Provags-ID: V03:K1:rcHlgj2KDDsKdTfg0oKXlZapjtrQVag0zgCE+wkxgjLzAGSEviq T53GGwTCNR9rVLdR/3jqP+ywDCS8OM+odM8e5y9WcId9mEzI+4shXpYsrKsuJl3BrG6xkl/ kso3l8qe8KU47cTD337Wyh61OfFihLybS70bhlOUvabzeyDL6aPQQMPgvQx+zrg9ku8PL3w 22XlN3DmK2rdem93hdbMQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:dH80FUuRGmk=:TMt6Tu59iJvUjcTWi/jiOu f4Q/mKEVErIHGKEk5wHF1SFR5/mR5aBvj3pRHS2CPXju6LAx4hwyka+pPhodr2w0mMhksfUzK fBXApZyrk2ciUlQ9RYROzFtl+KmG9bKQ7IZHPtUhng75KMVSoSHQL7fh3FxKUPDWEox4fV5pg jFsY1O0kljnGArjqffL/5EmR0COrv2+VUQiHEcMQp3Ey0XJStbG97TqdwAQFYnq1caMRIxpQv SuIOfBT9CtpDyPEDkC/0jpIDNhrNpfCH5E7M2YsJmaWEdd5gQ4rK8DidoTLbHYGhs0YSfhMqj CUkWMBFFY3v3Ril6vlJOaKJC3wj8hmtHEKCPDVkYowVsHUoEZ/djagQQG2BEtGFvqPqywZydJ roJDn7aBx+19Tqdvp0WwFjpDQ31MGjD4SXuof3CAC9WMwcNJKz+MUlzyD0/0c4KyrCtT1fjlx c2Vai8wzIpUPpNtGYWBAQKsqZLFCs9arGav9i6bFNb0EndXH0pLE055+y2goTOKMps9HKHBM/ OWywabOY5e76E1CsHjgR9T9fGX0a5rQ7UUmKrna8TqrLZWXhNabQC8rO9Pax07VfVy3h78Bzd xQopFAe1pu6H3w62jp8ttPUod8NjElZuCAYLzyhSTs5uS9YvtRJNZBxkWVQDkarmwbkPOum6m sgPNBHR3AGHMSADXS6PBp0blezZULA7PuccJpeOlFjwvIirE0JUaT/PDU7RFruuPtGawkJ1iz otHzrOKuwuc/0zYFDflL+6bYAqzcIyJ5upMhPcYAl6CC4qVZLtNaMIVWGE/R0ZPFPYjXVOyt5 +W7QVyQtPdueOK5UeMjHgCX/caGfT75Zj6LCNSYaU7ebDMfhcv9OIysbZKncrVWYmo4XMj94Q vYucFBWfwA+CYTtv5gPA== Subject: Re: [PHP-DEV] [RFC] Measuring maximum execution time based on wall-time From: a.leathley@gmx.net (Andreas Leathley) On 11.12.20 10:59, M=C3=A1t=C3=A9 Kocsis wrote: > That's why I'd like to add support for measuring the execution timeout > based on the wall-time. There are a couple of ways to approach the probl= em > though: > - by measuring wall-time on all platforms > - by adding a new "max_execution_time_type" or so ini setting for > optionally changing the meaning of max_execution_time (this is what HHVM= is > doing) > - by adding a new "max_execution_wall_time" ini setting for being able t= o > timeout based on both the real execution time and the CPU time. > > My POC implementation at https://github.com/php/php-src/pull/6504 curren= tly > uses the third solution, but I would be okay with the other possibilitie= s > as well (especially with the first one). I would also be very curious if > anyone is aware of the reasons why the CPU time metric was chosen back > then? In my opinion, wall-time is much more useful, but maybe I'm just > missing some technical limitations (?). For my applications the current behavior is the more important one, but implementing both (and being able to set both limits independently) would be an interesting improvement. Next to having hard limits, having a way similar to FPMs request_slowlog_timeout in PHP would be a useful addition in my opinion: to detect slow requests/scripts and report them, as that can be an early warning and something worthy to analyze. Basically, set a time limit for either cpu or wall time, or both, and if that limit is reached call a PHP callable to report it or handle it in some way (similar to how pcntl_signal can act on signals in an async way). This would open up more options, as the current max_execution_time or a new max_execution_wall_time would be a last resort, but most of the time I would rather know about a problem early on and log it.