Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47950 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11290 invoked from network); 15 Apr 2010 07:28:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Apr 2010 07:28:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike503@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike503@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mike503@gmail.com X-Host-Fingerprint: 74.125.83.42 mail-gw0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:47135] helo=mail-gw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/43-20494-510C6CB4 for ; Thu, 15 Apr 2010 03:28:21 -0400 Received: by gwb20 with SMTP id 20so577522gwb.29 for ; Thu, 15 Apr 2010 00:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=OXFEhNk24JYGwuVq7aVlj+K9+F/tcBhidno1aHtKjSk=; b=pfWYgeLP9FPmWlrT2AIYfgWk4vQlekylvNGZE3oeHoHkeyqFPIim74JEQzMcLVpkNJ bXIU8J1xFwBognboNOpWUuqL8N9QHspjPNpXzRwQyXCCjC+HxEa9PXTaRQRj+NqqPXwa guwOZtHhaNPq+G5/PXlF7DSv8dyH4gmm+0j90= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=PV1YXpAf8gIDrH4O5b4GksAv/XXKsikEIos99dD1x3sqIXfhwXQ7prvIeqJreuLwgc QiIEB4xZKv+sfMkRxAlincC/QIbno5Ya10DFrUwq+hT8EYwOZCZiCPKtnlzzf81UULZv VIWxAeI3Be3vG41QRlf5kxlPumS9H8yGyhNko= MIME-Version: 1.0 Received: by 10.231.54.199 with HTTP; Thu, 15 Apr 2010 00:28:18 -0700 (PDT) In-Reply-To: References: <4BC58D10.4050609@lerdorf.com> Date: Thu, 15 Apr 2010 00:28:18 -0700 Received: by 10.151.61.3 with SMTP id o3mr515607ybk.252.1271316498912; Thu, 15 Apr 2010 00:28:18 -0700 (PDT) Message-ID: To: Ferenc Kovacs Cc: php-dev Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] One suggestion to PHP-FPM From: mike503@gmail.com (Michael Shadle) On Thu, Apr 15, 2010 at 12:09 AM, Ferenc Kovacs wrote: > My suggestion is more about releasing the allocated memory as soon as > possible. That is, this option is similar to "max_requests". > PHP-FPM would kill the PHP process if the requests a process handled > exceed max_requests, and similarly, PHP-FPM should kill the PHP > process whose memory usage exceeds "exit_on_memory_exceeds". > > So one of your lib (for example imagick) leaks memory, on the long run, it > will exhaust the memory limit, and will kill a totaly request. > You can set that how many request should be served with one worker, but you > can't soft limit it's memory consumption. > This is what the patch does: > if you set the hard limit: (memory_limit) you can guarante that no process > will use more memory, because if it tries, it will fail. > and you can set soft limit, if that reached, the process will die and > respawn after finishing the current request. Sounds like you more or less want a "request_terminate_timeout" type of functionality but based on memory. Since set_time_limit() and other things in PHP don't seem to force kill the process. So PHP-FPM forcefully terminates the process based on the actual wall clock seconds. I'm thinking you're hoping for the same thing to be possible but for memory limits per-process? I would say that could be cool, either per pool or per child somehow. No clue if it is possible, but that would be a great way to limit the usage *forcefully* - helpful on lower resource machines (like a vps...)