Re: memory issues when running with mod_perl

From: Andreas Rieke <andreas(dot)rieke(at)isl(dot)de>
To: pgsql-general(at)postgresql(dot)org, kleptog(at)svana(dot)org, postgres(at)2xlp(dot)com
Subject: Re: memory issues when running with mod_perl
Date: 2006-09-30 08:02:02
Message-ID: 451E247A.8030307@isl.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn,

> Are you sure you're looking at the right numbers? Disk cache should be
> counted as part of free memory, for example.

I am the guy who posted the problem to mod_perl, and yes, I am quite
sure that we are talking about the right numbers. The best argument is
that the machine in fact starts swapping when memory is gone - and this
means there is neither free nor cached memory left.

> Could you provide some actual output of your tests, so we can see
> exactly what you mean?

Several examples have been discussed in the mod_perl mailing list, just
have a look at
http://mail-archives.apache.org/mod_mbox/perl-modperl/200609.mbox/browser
However, maybe my configuration is quite a good example as I am using
very current software packets.

Linux 2.6.13-15 (SuSE 10.0 i586)
Apache 2.0.59
Postgresql 8.1.4
mod_perl 2.0.2
perl 5.8.8
DBI 1.52
DBD::Pg 1.49
Embperl 2.2.0
OpenSSL 0.9.8b.

When I boot my machine with 1 G physical RAM and about 4 G of swap
memory, it uses about 300 M for the os, apache and pg, and the rest is
free. As usual, the free memory goes to cached memory after some time,
no reason to worry.
However, within two weeks, the cached memory becomes less and less, and
the machine starts to swap. When I stop apache at that time, I get some
100-150 M back, however, when I stop pg, I get nearly nothing back; on
the other hand, it does not cost my anything if I restart pg, whereas
apache of course takes back the 100-150 M. When swapping increases, the
machine gets slower and slower, until it does no longer answer anything
except ping.

I thougt about a kernel memory leak for a long time, however, in the
mod_perl mailing list we heard about someone reporting the same problem
in BSD, and for that reason, this is maybe the wrong way. Using ipcs, I
see that the postmaster uses 10 M of shared memory, why do I not see any
increase of free memory (or cache) when stopping pg?

Thanks in advance,

Andreas

P.S.: Jonathan has described nearly the same thing in the mod_perl list
on Wed, 06 Sep, 21:36.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniele Mazzini 2006-09-30 10:51:07 Dynamic access to record columns (in PL/pgsql)
Previous Message Ken Johanson 2006-09-30 04:46:57 Re: PG Rocks! (was:Backslashes in 8.2 still escape, hwo