Subject: Re: Excessive swapping / Memory problems
To: Vincent van Scherpenseel <mailinglists@vanscherpenseel.nl>
From: Quentin Garnier <cube@cubidou.net>
List: netbsd-users
Date: 09/07/2006 00:42:57
--/zLL6W406Aotuby1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 06, 2006 at 10:55:31PM +0200, Vincent van Scherpenseel wrote:
>=20
>=20
> Chuck Swiger wrote:
> >On Sep 6, 2006, at 12:40 PM, Vincent van Scherpenseel wrote:
> >>>"top -o size" will show you which processes are requiring lots of=20
> >>>memory; it's possible that one of them is leaking, or it may simply=20
> >>>be that you are trying to run too much on a machine with limited=20
> >>>RAM.  Increasing the amount of RAM in your machine is probably going=
=20
> >>>to improve the performance of the system significantly...
> >>
> >>The strange thing is that it's a very low loaded machine, only running=
=20
> >>an SMTP server for my daily mail (about 50 messages a day) and a=20
> >>webserver for my personal website (http://vincent.vanscherpenseel.nl).=
=20
> >>Most of the visitors are spambots targeting the blog comment system (I=
=20
> >>really need to implement a CAPTCHA check, I know).
> >>
> >>Here is the top output of top -o size:
> >>
> >>  PID USERNAME PRI NICE   SIZE   RES STATE      TIME   WCPU    CPU=20
> >>COMMAND
> >> 9747 www       -4    0    35M    4K semwait    0:32  0.00%  0.00% httpd
> >[ ... ]
> >
> >Ah, eight to ten 35MB apache children will consume most or all of your=
=20
> >RAM and swap space.
> >
> >Apache normally uses a lot less; a stock Apache-1 without anything=20
> >expensive will take 5-8MB, and even Apache-2 + mod_perl or PHP takes=20
> >around 15 - 20MB; perhaps you can reduce the max # of children running=
=20
> >or remove a module or two that is bumping your memory usage up so much...
>=20
> Yes, but how does it come that it's taking 35megabytes? I'm running=20
> Apache2 with PHP. I never had these problems. Like I said: I hardly ever=
=20
> get any visitors so I could probably reduce the number of childs.=20
> However, I find it rather strange that these problems suddenly occur.

I've seen some scripts make the PHP module leak memory _very_ fast.
I have witnessed similar trouble on a machine of mine once (a sparc64).

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--/zLL6W406Aotuby1
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iQEVAwUBRP9O8dgoQloHrPnoAQJu7QgApiVfmuj6Qf9sWDO1w1J/OZD+UrrMnC95
pfC54Jus3fjBa26zzGw7MRt4lEbpP7OrgWOCzGM2TsOf1SjsaAn717Naim6eisXG
zyQRls/EKD8cbT52pEA7PVdpXmFHrlmNNQ3e/VGeMCsmcGnBPEJBnK7vLGKjjxxz
wqBmCGBKT9/sc7c6p/J/XbQxGz/ShaJiNt4MaZUrxthSZ4eV5L6Fmd/2RTTdKzlN
htfBQNEZHUtMviDHtjDDamqAx9DTNqv6y0R69Y1CgHsKpuo7q1bEW4WngbV792k2
esjlbwEbS7kQIJcNoGoFAz1+F/kz0hlb4uyd0ZsEzYhPieOm3eZDVA==
=e6j+
-----END PGP SIGNATURE-----

--/zLL6W406Aotuby1--