Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115581 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33187 invoked from network); 25 Jul 2021 11:17:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jul 2021 11:17:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BFEE1180212 for ; Sun, 25 Jul 2021 04:44:15 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 ; Sun, 25 Jul 2021 04:44:15 -0700 (PDT) Received: by mail-il1-f169.google.com with SMTP id 10so6019678ill.10 for ; Sun, 25 Jul 2021 04:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+Lp3CxVCxWy9nr20myNE4po1nShrkppsl38gj6OV+uU=; b=Sv/cFiSPuPyJD1Xg3nz3h4WrCvOJ2TNzHghZxyedbWJQoCiz6yRpD/TUcQyN9dqcbK /w79//MsnvdjzfPZ7JJ++EeteCVzoB+2Ht7MJpYyO8n0g3i6uGUEq8o2zlfBxjJkuAU0 Fm0flBbZ5lkXB0fij+eKnReUkxRmDqInLC3QAm3DuGC5AxQsxhLmZFCZrWDdV8TuLg1L a6PEMJBa1LoS7rsZ89itL0PlpqSqGw4rfZOl9wlxCsZbdUnbUlevkPWNi9iSUVx/Mq89 lf9oSfR6/dn/LFvuCJH8B7TRx7Eerk3vjJxW6C/A2/LlT4/JWLQxkICLO6R2xsvZOmae z/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+Lp3CxVCxWy9nr20myNE4po1nShrkppsl38gj6OV+uU=; b=cFTrH62QoBDrDCVKVTvjUGkcPoNc0RS7xiIVA9DC3iLjn/S7cSm3/tafE/1V+tesfc NErK0ccts5U4+HH3010z3d3Wpk2oDJk6lBQ9hbivaeGJSRtKQ3dhK4wgBnIZtbeFxYHC eJwb1eC5uXgqhxJ9xMxdW0enh3/nLZiHF9ExVcFgSf9jw4nnMardwy/FWM2dvC0MRW1I 250lgd6E5hMxen6gezwsqKDtwsYb0grgOHFdJOALiinyCCAGQYmlnjWJi0tFcsET+sjM ub2acy8v0Rb1MWNLBR0LCsRdZAWl6oD0V01lgBmaFdxLco2eCcHqacdCc52DWD8pLfYZ kNUA== X-Gm-Message-State: AOAM5331WwD1ZpFxswpwC5MPyb1ehfnT87fNyUi68Wq8A5t5pXOkwvVr b7MWhWz3uO4usFJmn2tG1vvSkspruHc+9rGI2Gu0Jia1F2DsEg== X-Google-Smtp-Source: ABdhPJzsrBQLgVepeB5byHJujNYqIS7OhsLZXBDxF1VWsCuU875wvbhV63L/LC7BAuMrW72uOtxKWwdL8Tgr2rDGdlw= X-Received: by 2002:a05:6e02:dc4:: with SMTP id l4mr9769087ilj.94.1627213451510; Sun, 25 Jul 2021 04:44:11 -0700 (PDT) MIME-Version: 1.0 Date: Sun, 25 Jul 2021 13:43:36 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000c0490c05c7f12726" Subject: [RFC] Wall clock time based execution time From: deleugyn@gmail.com (Deleu) --000000000000c0490c05c7f12726 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello everyone! A few months ago there was a proposed RFC for having wall clock time for timeout [1]. It seemed like there was not a lot of push back against it [2] with an exception of Nikita's comment about having 2 ini settings vs having a toggle on the existing ini setting [3] [1] https://wiki.php.net/rfc/max_execution_wall_time [2] https://externals.io/message/112492#113210 [3] https://github.com/php/php-src/pull/6504#issuecomment-743064911 The reason I'm bringing this up is because I'm interested in the possibility of having this functionality in PHP as a potential solution for serverless environment hard limits. The number #1 issue with running PHP on AWS Lambda via Bref is caused by API Gateway having a hard limit of 30 seconds. When combining that with the fact that AWS Lambda inside VPC loses internet connectivity (unless a NAT Gateway / NAT Instance exists in the VPC), it's extremely common to have code attempting to connect to a database, make an API call or try to upload data into S3 and get confronted with Server Error - Task timed out. This gets aggravated by the fact that we have no opportunity to flush out logs, meaning any attempt to write logs to stderr is simply lost and it makes it an arduous task to debug. I did a quick testing around register_shutdown_function and it seems to provide what we need if we had wall time-based timeout. ```