Re: measuring shared memory on linux (was [Fwd: Re: /proc/*/statm, exactly what does "shared" mean?)]

[prev] [thread] [next] [Date index for 2005/02/15]

From: Stas Bekman
Subject: Re: measuring shared memory on linux (was [Fwd: Re: /proc/*/statm, exactly what does "shared" mean?)]
Date: 21:50 on 15 Feb 2005
Perrin Harkins wrote:
> On Mon, 2005-02-14 at 18:45 -0500, Stas Bekman wrote:
> 
>>that approach is not very practical if change your code base constantly. 
>>Since you will have to retune things every time you change your code.
> 
> 
> I know, it's terrible, but it's all I've come up with so far.  Maybe we
> need to rethink how the size-limiting modules work so that they can use
> something like the total amount of free physical RAM instead.  I think
> that's sort of what you were thinking of too.
> 
> 
>>I'd rather see the kernel providing a new feature which tells us the exact 
>>amount of memory used by a group of forked processes (swapped in and out).
> 
> 
> Me too, but I'm not holding my breath.  We can find out how much total
> memory is free though, at least on Linux.

That particular information is far from being useful, since there is the 
cache. On my (linux) machine I have 0MB of free memory and 400-500MB of 
cached buffers. So on linux one needs to combine the two to get the 
answer. (see the output of free(1) on linux to see what I'm talking about)

So what you are saying is that whatever the technique is to get that 
remaining free memory, if we have it we could just set a limit on how much 
"free" memory is available and start killing Apache procs, when that limit 
is passed. I think that might just work. The roughest approach will be to 
just kill the current process. The fine tuned one will be to maintain a 
table of proc sizes as I've suggested before.


        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: measuring shared memory on linux (was [Fwd: Re: /proc/*/statm, exactly what does "shared" mean?)]
Stas Bekman 21:50 on 15 Feb 2005

Generated at 10:23 on 16 Feb 2005 by mariachi v0.52