Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126255 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 26B541A00BC for ; Fri, 31 Jan 2025 10:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1738319011; bh=cSVuc+z9X7hV7uO+1UhpfheOLp8MDUAMV+6R1E/2Z+A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oF7bsLN7pnYBL34b7jbmq3oxx8AafBhfZrpojYySD75lR0S/K5avb76Kx7mofNpsw 53K7Rwn5o9WVWJgkbntYX930mcfNaAHhPJ90XeeML2nOOyytFuA65C73wr9tIBZ8FM WxJn3Oqb4fbhFYpnQaT5Pnnwk0SBzSM1f+yWpwo4Eo2D+NQ55zBmGwAw3HN00NU3N7 WsYrThINYph3C5KGEpcRDB8HZtCojmkzquHWBI8VpWX73dSS99thYAPg4MQCI4HD6+ 5GojlsFIfbjl7kvWucTaVU4TsbDEGmj5XIlQgig8cuX0mR8WVKRikdd7hxl3aDN3Pt zMBBCcuJkH2zA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9769518006A for ; Fri, 31 Jan 2025 10:23:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 31 Jan 2025 10:23:30 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-2b199bb8af9so1433104fac.1 for ; Fri, 31 Jan 2025 02:26:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738319177; x=1738923977; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cSVuc+z9X7hV7uO+1UhpfheOLp8MDUAMV+6R1E/2Z+A=; b=B4oGb1T/hZrepcdRhTurBv5gUaJKICRFZiw7oXZRESTm1Wd3X2N1CxzNCnf8IcKDNt +0wleEizeMiK7qJy5LtTi1dAN4ootmbvV+HPhWdTyf9XOXYgRttY75pbYhAt6ZJw1X8T Yi1HHJGvc9elNTxf0qBI3q4wmaJReYnuRD5A8ABoDzi7W3HzYlUgMCcDP5H96mPDGDHq In256AcPZVfx286KsBQBkmZExdJwpMK7PzdF3CHLhR0JhLJg0x+h1x2xDMbcpCxwTc5d Dt/UBE7VWgJJbWZDFFOoLFOxHUB/N/EQ5xMUXiBNSVmb4O59VY1Q0bhU5CS8mQ+od2cC Q4ig== X-Forwarded-Encrypted: i=1; AJvYcCV+HwYEmor1j+6ADUMQQdmX8bHP5xn9FPSD4uCU849Ueer9Rcb7eDaA4tJd82FEmhYX8aHfmVi5E5s=@lists.php.net X-Gm-Message-State: AOJu0Yxgd66IKlpcfqkSNhimo5OUgrkaSX6KwPaBzbJHJNsqJKi/Xsm9 fjiu9/UMLDFE7DQIYSJzSm2Ofn4MqvPQVko6cj6TkQC/soAPtJa7lYXVOmYRyUjSeoujFbLooed EckwzSVkdWQI3xO+/fu4WGkcaqfk= X-Gm-Gg: ASbGncu05Ly674YehxoHWe0XI2jGuG3pnlVtq8/IiQsk2Sj5aIoEnB0/v90etx5CTnZ Z7f9sUjdpZLSIhZ1JxfngiyT0vjbCU8xHPtjDkUHox/L/olbJvN/KM4xxwgmxXdbvk2YQGU0t X-Google-Smtp-Source: AGHT+IGRIYBlAYsKgqKn+PPkRXjvq9XDj+wJ5l2oTxkbhaEaLrUEdg71wYvJrp39baLngNTKQULOo8MV2ircP9/ho2c= X-Received: by 2002:a05:6871:2b07:b0:29e:1962:7a23 with SMTP id 586e51a60fabf-2b34fe05edamr6047029fac.4.1738319176859; Fri, 31 Jan 2025 02:26:16 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <3624b46b-16f2-4eb3-b1ac-d0439cd79153@app.fastmail.com> In-Reply-To: <3624b46b-16f2-4eb3-b1ac-d0439cd79153@app.fastmail.com> Date: Fri, 31 Jan 2025 11:26:05 +0100 X-Gm-Features: AWEUYZlI4pOOV5QLRp4kPHnw_GaeUXiM2CtHwNdRMIHbiA3gSkNIrxr8R6UyVX4 Message-ID: Subject: Re: [PHP-DEV] [RFC] Introducing pm.max_memory for PHP-FPM To: Rob Landers Cc: Arkadiy Kulev , internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000000b07b5062cfdf999" From: bukka@php.net (Jakub Zelenka) --0000000000000b07b5062cfdf999 Content-Type: text/plain; charset="UTF-8" > > > To be honest, I haven't seen a 'slow' memory leak in a long time -- except > when using fgetcsv which has had a reported memory leak since ~2012 > somewhere on the old bug tracker. (I lost the link to it and don't even > remember how to get to the tracker or if it still exists.) I haven't > checked if it has been fixed since 8.2, but I've seen a couple of reports > of it on r/php a couple of times in the last couple of years. > I think it might still happen from time to time in external extensions. Just recently Niels fixed this one https://github.com/php/pecl-xml-xmldiff/pull/3 . In addition there can be also a bug in an external library so it's not unlikely that there are still many such cases. Currently many people just have pm.max_requests in configuration for that which is sometimes set to unnecessary low value. Having option that depends on memory instead could reduce significantly the number of restarts - in most cases probably to zero. In addition, it could also help to identify that there is a leak which can get unnoticed if the users don't have alarms on memory usage or just use pm.max_requests. Regards Jakub --0000000000000b07b5062cfdf999 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

To be honest, I haven't seen a 'slow' memory leak in a= long time -- except when using fgetcsv which has had a reported memory lea= k since ~2012 somewhere on the old bug tracker. (I lost the link to it and = don't even remember how to get to the tracker or if it still exists.) I= haven't checked if it has been fixed since 8.2, but I've seen a co= uple of reports of it on r/php a couple of times in the last couple of year= s.

I think it might still happen from= time to time in external extensions. Just recently Niels fixed this one https://github.com= /php/pecl-xml-xmldiff/pull/3 . In addition there can be also a bug in a= n external library so it's not unlikely that there are still many such = cases.

Currently many people just have pm.max_requ= ests in configuration for that which is sometimes set to unnecessary low va= lue. Having option that depends on memory instead could reduce significantl= y the number of restarts - in most cases probably to zero. In addition, it = could also help to identify that there is a leak which can get unnoticed if= the users don't have alarms on memory usage or just use pm.max_request= s.

Regards

Jakub


--0000000000000b07b5062cfdf999--