Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jul 2003 15:46:39 -0400
From:      Vivek Khera <khera@kcilink.com>
To:        hackers@freebsd.org
Subject:   process sizes
Message-ID:  <16133.55711.263062.288990@yertle.int.kciLink.com>

next in thread | raw e-mail | index | archive | help
Hi, we're preparing another update to the mod_perl (version 1)
release, and there is an issue with the Apache::SizeLimit module for
it under *BSD (in my case FreeBSD specifically).

The purpose of the SizeLimit module is to enable the server to
gracefully exit when it is using more resources than it should (for
example, after running a large database report) it can gracefully exit
once done.  So far, the most effective use of this module is to limit
the amount of "unshared" data space it is using, as one of the major
benefits of mod_perl is to share much of the perl code pages (which
are data as far as the OS is concerned).

Now, currently, the BSD code from SizeLimit reads like this:

sub bsd_size_check {
    return (&BSD::Resource::getrusage())[2,3];
}

This routine is intended to return the current process size and shared
memory size.  However, the getrusage() above is not really doing what
is intended.  The shared pages value returned is way wrong (only text
pages are given by getrusage) and the current process size is not the
MAX RSS, which is returned above.

I'm at a loss as to what to use to measure the current process size
and also to measure the amount of virtual memory in use by that
process that is in shared pages.

If anyone has good code to get this information on FreeBSD (and other
BSD's in general) please let me know.  If additional libraries are
needed, that's ok.  If we have to poke around /proc, that's ok to.

I'd appreciate direct replies since I'm away at OSCON next week and
don't want to miss anything.  Thanks.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16133.55711.263062.288990>