On Thu, 2005-02-10 at 18:28 -0500, Richard F. Rebel wrote:
> As far as I know, especially on linux, there is no way to tell exactly
> how 'shared' your apache processes are, except by using apache+mod_perl
> with GTop (and it's associated apache module).  I certainly don't know
> of a way to get this figure from the command line.  Maybe someone else
> on the list does.

You can read it from /proc.  From Apache::SizeLimit:

sub linux_size_check {
    my($size, $resident, $share) = (0, 0, 0);

    my $file = "/proc/self/statm";
    if (open my $fh, "<$file") {
        ($size, $resident, $share) = split /\s/, scalar <$fh>;
        close $fh;
    } else {
        error_log("Fatal Error: couldn't access $file");
    }

    # linux on intel x86 has 4KB page size...
    return ($size * 4, $share * 4);
}

- Perrin

Reply via email to