From dev-return-1974-apmail-perl-dev-archive=perl.apache.org@perl.apache.org Tue Nov 06 07:20:53 2001 Return-Path: Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 75917 invoked by uid 500); 6 Nov 2001 07:20:52 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 75906 invoked from network); 6 Nov 2001 07:20:52 -0000 Message-ID: <3BE78F5B.1090407@stason.org> Date: Tue, 06 Nov 2001 15:20:59 +0800 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011012 X-Accept-Language: en-us MIME-Version: 1.0 To: dev@perl.apache.org Subject: [Fwd: swapping of mod_perl parent process / mlockall()] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Adi has asked this question some 4 months ago. Do you think this suggestion of using mlockall can improve memory usage? -------- Original Message -------- Subject: swapping of mod_perl parent process / mlockall() Date: Tue, 26 Jun 2001 11:04:41 -0400 From: Adi Fairbank To: modperl@apache.org Is it correct that when the Apache/mod_perl parent process swaps to disk, a large part of it (swapped pages) becomes unshared? Even after the kernel restores the pages from swap, do they remain unshared? So once the parent process becomes unshared, new apache children that are spawned only share the parent's pages that have never been swapped? This is what I've grok'ed from my experiments with top/GTop. If this is the case, it would be helpful to prevent the parent process from *ever* swapping to disk. The Linux kernel has a system call mlockall() which disables all memory paging for the current process. This sounds like exactly the recipe for preventing parent process swapping. It won't affect spawned child processes, so shouldn't pose a threat of consuming all physical memory and crashing the system. I want to play around with this, but I'm not sure where in the mod_perl source to call mlockall(). It would need to be before the parent spawns any children.. Has anyone tried using Linux's mlockall()/mlock() with mod_perl? -Adi -- _____________________________________________________________________ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org