Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90956 invoked from network); 26 Apr 2010 15:20:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2010 15:20:45 -0000 Authentication-Results: pb1.pair.com header.from=tly.phpfans@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=tly.phpfans@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.221.191 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tly.phpfans@gmail.com X-Host-Fingerprint: 209.85.221.191 mail-qy0-f191.google.com Received: from [209.85.221.191] ([209.85.221.191:50115] helo=mail-qy0-f191.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/C6-58325-C4FA5DB4 for ; Mon, 26 Apr 2010 11:20:45 -0400 Received: by qyk29 with SMTP id 29so8249913qyk.2 for ; Mon, 26 Apr 2010 08:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=AqBO3ciuEAjK5OB/vtWPwFMlvAGsZKEouDuTn9VT6PI=; b=UfHKBSSIUWWpdaPh1T7FGm4WsSOh9ULrje+q9ojZ1NZ5gy5C26Ek0V/lddeEmxBpVK W7nvdDuCOdrGXkBJKVmXHxrLHx3S/Asz9VKxYOYsBFkbFpaooYU4ESzscIA1JB981w7d ZlAOdQ64anJVfkCLKq/hV6P9SyLsZaJ20aKpo= 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 :content-type; b=fCnzpaOphvE135TMvtvK90Jrk9nVbhf1UzsQFyry0FQse81yn2gVf8eYp+qzoznKMj QhUqd66xZM5ik19ak721Y6VUA9hHd0fFD0VTUVZDY+YHKWuZAUQ+VI95jYbkOoeiVguv F5TEmK8yTPuBbf/7Gjvy3Wq14RVXrEKXTrH6M= MIME-Version: 1.0 Received: by 10.224.59.100 with SMTP id k36mr1289936qah.139.1272295241703; Mon, 26 Apr 2010 08:20:41 -0700 (PDT) Received: by 10.224.29.6 with HTTP; Mon, 26 Apr 2010 08:20:41 -0700 (PDT) In-Reply-To: <36701B7BE4054FB3A72CFFB6B8A81DF5@KD5> References: <4BD54437.2020304@daylessday.org> <4BD54D42.5070400@daylessday.org> <4BD564A9.2060000@daylessday.org> <4BD57525.50803@daylessday.org> <36701B7BE4054FB3A72CFFB6B8A81DF5@KD5> Date: Mon, 26 Apr 2010 23:20:41 +0800 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=00c09fa21a7aee611b0485255189 Subject: Re: [PHP-DEV] One suggestion to PHP-FPM From: tly.phpfans@gmail.com (looyao teng) --00c09fa21a7aee611b0485255189 Content-Type: text/plain; charset=ISO-8859-1 Thanks for your continuing discussions, as the person who gave this suggestion, I want to express my ideas. 1. The focus of this suggesting is that to free the occupied memory in order to memory can be used efficiently, at the same time, system have more free memory to allocate. This has noting to do with how many memory the server has, usually our server have 16GB memory, and sometimes our server also crashes. Though this requirement my be associated with the error handler of Imagick self, our aim is to let it run more valueable. And other circumstances maybe have this problem , such as large data operating, and the occupied memory will not be freed until the process exit. 2. The PHP's management of memory can't give the occupied memory back to the system by itself. 3.Though the idea is good,it cannot acquiret the actual state of the memory usage of the process for PHP. Meanwhile,the other methods are not good enough in a way,such as cannot run on multi-platform.So we hope to try to monitor and manage the heap memory.After all,the used memory of PHP itself is relatively stationary.And the memory_limit is ought to limit the heap memory. So, when it go beyond the limit,kill the process in order to release the memory. 4. I'm agree that it's not necessary to realize this feature in SAPI, but it may be not easy to realize in other pleaces, because it must check after current task execute, and SAPI is not all like FPM that is independent process existing. 5. Now that FPM is one process manager , it allows work processes exit after excuting some times, and it kills work processes according to the memory usage is the similar requirement. 6. I do not install memtrack, according to the README, I think it's not my really want , the focus of my requirement is not to log or throw exception, because I know my problem is what, I need to solve it, and the solution is to exit. 7. Now our solution to handle this problem is (1) control max_requests little as possible (2) control memory_limit low as possiable (3) write a shell , check the process usage, kill it when memory out of limit. and we think if this suggestion could be accepted, wo can let config more easy , at the same time, memory can be use more efficiently. Because shell maybe kill the process which is handling request. I also hope that it can be realized in SAPI or other places, before there is no more better solution, first to achieve this relatively short-term solution. --00c09fa21a7aee611b0485255189--