perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip M. Gollucci" <pgollu...@p6m7g8.com>
Subject Re: Prefork not sharing on FreeBSD, but sharing on OSX ?
Date Wed, 23 Aug 2006 22:39:27 GMT
Jonathan Tweed wrote:
> www     60645  0.0  5.8 73068 60504  ??  S     8:25PM   0:00.00 
> /usr/local/sbin/httpd
> 
> mean that 73068 - 60504 = 12564 is shared (at least according to ps)?
No, thats supposed to be ~73MB is the address space mapped by the process
~60MB is actually resident in memory.  The busier your server the closer this number will
get to matching each oterh.

Assuming you've got 100% sharing, you take the parent size which should stay near perfect
and substract that from your child size.

Or you use Linux::Smaps, or getrusage(3), or GTOP

in actuality, you'll probably get 40-60% sharing on a good day after some use.

You can guess at this number if you can't use any of these tools --
Ask yourself this question, how much memory _MUST_ be shared or I would be swaping ?
Assuming you have enough children to max the box out.

The only number in FreeBSD I know of that *should* actually reflect something near this is
   ru_ixrss     an ``integral'' value indicating the amount of memory used
                   by the text segment that was also shared among other pro-
                   cesses.  This value is expressed in units of kilobytes *
                   ticks-of-execution.  Ticks are statistics clock ticks.  The
                   statistics clock has a frequency of sysconf(_SC_CLK_TCK)
                   ticks per second.

from getrusage (3)

also remember the units ARE NOT the same as

ru_maxrss    the maximum resident set size utilized (in kilobytes).

despite every BSD's manpage getting it wrong.
one is in Bytes the other in KiloBytes.

For instance I run a QEMU based VM on FreeBSD

root      77406 91.8 33.0 1086556 342588  p3- R    16Aug06 9514:55.14 qemu

This also makes sense because I've only 1GB of physical RAM on this box (different box from
the httpd one).

I've told it it an use 1024MB of memory (1086556) at current however, its only got
342588 (342MB) of it in Physical RAM the rest is unused at the moment.

For httpd this difference is much lower because it needs more in RAM to do stuff
and sizes are much smaller.

If it was me, I would do NO MEMORY STATS on OSX any version -- other then rough total process
size.


-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."
    __  ___     ___ ____  __
   /  |/  /_ __/ __/ __ \/ /
  / /|_/ / // /\ \/ /_/ / /__
/_/  /_/\_, /___/\___\_\___/
        <___/

Mime
View raw message