Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112523 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89856 invoked from network); 15 Dec 2020 23:42:00 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Dec 2020 23:42:00 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6B5BD1804F3 for ; Tue, 15 Dec 2020 15:13:03 -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_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (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 ; Tue, 15 Dec 2020 15:13:02 -0800 (PST) Received: by mail-lf1-f54.google.com with SMTP id m12so43719402lfo.7 for ; Tue, 15 Dec 2020 15:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gyCepHC11kFtQIp7q6fP66ckfQrdVPeEFttE+o1XhUs=; b=gOFm/ENJbcboz1oEjbMf9sRLFTG4FzlmOsTgviJxVcgiKBQMYAVUCqi7tSzIVsl04P LKyplKXSDqRIK8K7aDU5Xl/xahWJI67SZbv0DOE1OO83FdyqNdRolEo2Q91/NeX0yMgU 40Bx0PaxBoLlRIjZWckdQSfYS1i3MY5FEimx8a4e2B7lGeKA9GKw/8O3LmvKD1tff/P+ sokXgCs8pAOw+Qp95sau+6ijRPm0DxMgCKca54Gp6CBsUPxAVvmwvhHrTlt4o8SHVJzi sDaf1yKGtoqyBL1vjTBdPeUOGJ4utGVT2P3daaGbWrtHtzcV2ENpUAL0vJyV0sxHbQAQ c7DQ== 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=gyCepHC11kFtQIp7q6fP66ckfQrdVPeEFttE+o1XhUs=; b=ljrvjdI3um5ZnA+1VwzeQ/LUctAgoG9ZDynaz2LncvEKQhbWdfqWR3mRXWeD/y22Pu v4ApQtwIxg9+Vsrf/tBYCge69+mya8Vjekv1j4FXBMEajdwM8kprRW/iT4uL8JB05sj9 VOoePO3hZIT41Z9x7+YDtLogNFz/SMuzISVbeWERbhr24ggzrhx8pTz+aLblNPo44kJW JGZ7Y/sF46CSDY1iuMhZVX7ON2R7VUrDeWFSu39TF2tmKk2ZHYyShfl0+HzaYC87UILS Rx8lOXwZF0gM2L+YKE5CY8qwLMEFAKFEbfgEk24cQDGjuAEx3byAoyw89yOxBLAF+6iU y2ug== X-Gm-Message-State: AOAM5332M3YDHxybvPTsREyTIjCQUN3CSFYn4V/ZRCiAIW2cm6N2Yza9 35z3UnlP7krJ/prJZnUWk8d+YrZaIKE3o8V2rlQjzSiA0qg= X-Google-Smtp-Source: ABdhPJzq3cbsyrMgqk4FgtQnc5KoSxMfpFKntBgrTYgK5I4VN6vINKVFmtNfRpHPepcq3m3F+fr8HlxAip4phzWbCeU= X-Received: by 2002:a05:6512:693:: with SMTP id t19mr776591lfe.22.1608073981456; Tue, 15 Dec 2020 15:13:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 16 Dec 2020 00:12:50 +0100 Message-ID: To: Benjamin Eberlei Cc: PHP Internals List Content-Type: multipart/alternative; boundary="0000000000006ff36705b688e6c5" Subject: Re: [PHP-DEV] [RFC] [Discussion] Measuring maximum execution time based on wall-time From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --0000000000006ff36705b688e6c5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Rowan and Benjamin, we talked about this before and I think it's a good addition. Two > suggestions to improve the RFC: > Thanks for the ideas, I'll incorporate more details about the interaction of these settings. And I've just collected a few examples when my proposal would be useful: https://gist.github.com/kocsismate/dbcc4ba81b27cfb2e25b949723bb7c79 . Their intention is to illustrate that no matter how tight the individual timeout settings are, if the number of external calls is high enough during the same request, nothing (*) can prevent the response time to skyrocket until all the workers become busy, causing outage because the web server can't serve any new connections. *except for some more complex, or non-clean mechanisms, which are outlined in the RFC, I'm struggling to picture when I'd want a hard wall-time limit, rather than= : > - checking the script's duration at key points where I know it can > gracefully exit, ensure a consistent state, and return an appropriate > message to the caller > - enforcing a network timeout on the calling end so that I don't need to > rely on all services cooperatively exiting in good time In my opinion, the main problem with the first suggestion is that in most cases, non-trivial production code can barely do anything like "checking the script's duration at key points". If there are enough levels of abstraction, the outermost layers (e.g. controllers) can't do any checks, they simply have not enough control. On the other hand, having assumptions about the request duration in any inner layers (e.g. model if we take MVC as an example) is a bad idea according to my experience. I admit though that there are some cases when it is possible to add the checks in question, but I believe that would result in a very noisy code, while a simple ini config would do a much better service. Do the above examples and this reasoning make sense to you? Also, I'll improve the wording I used when describing the consequences. Regards, M=C3=A1t=C3=A9 --0000000000006ff36705b688e6c5--