Subject: Re: Re: What's in my swap
To: Martin Husemann <martin@duskware.de>
From: Joel CARNAT <joel@carnat.net>
List: current-users
Date: 08/01/2006 14:02:11
--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 01 2006 - 20:43, Daniel Carosone wrote:
> On Tue, Aug 01, 2006 at 12:31:01PM +0200, Martin Husemann wrote:
> > On Tue, Aug 01, 2006 at 12:27:21PM +0200, Joel CARNAT wrote:
> > > I'd like to know why my (server) machine uses swap.
> > > I checked 'top' and 'vmstat' but didn't find any information related =
to
> > > content.
> >=20
> > I think you are asking yourself the wrong question. Applications do not=
 use
> > swap, the system uses swap when a lot of memory is allocated by applica=
tions.

well... seems I didn't expressed it correctly :)
what I wanted to say is: how can I tell which appplications were put on
swap ?

I would expect those to be idling and then tweak them.
The server were I see such behaviour is an app gateway with, among other
things, squid and amavisd-new.

Stopping squid frees nearly as much 'used swap' as indicated in the 'RES'
column of the top command for the Squid process. This indicates, I
guess, that I can lower cache size - to have it keeped on RAM.

Other heavy "RES" owners are perl processes - which I expect to be
amavisd-new child. But before testing stop/start and lowering the child
forks, I would like to be sure those are in swap and not in RAM.

Thats why I hoped there would be a lsof like command that would say
"process X has Y data in RAM and Z data in swap"

It's not that I particulary don't want things in the swap.
It's just that I expected to size RAM affectation (I'm in a Xen
architecture) correctly and I'm wondering if I need more RAM or if I
need to lower daemon foked childs.

With top, I can see 26Mo of used swap and 96Mo of free memory.
That's why I'd like to know what's in swap that the kernel didn't want
to leave in RAM (or didn't put back in RAM yet, because unused).

>=20
> Not only then - or rather, not only by applications.=20
>=20
> Very-idle processes can get paged out in favour of using the memory
> for disk cache, too.  This is probably what's happening if you
> wouldn't otherwise have expected anything to swap.
>=20

I did try to lower "disk cache" using `sysctl -w vm.filemax=3D5
vm.filemin=3D1` to see if cache would be flushed but I still have more
than 5% (12Mo File on 256Mo RAM) so I thought this was not the "good"
way to go :)


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

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

iD8DBQFEz0LD0/VH7L7F7Y4RAvATAJ4qRK0QypqwRxafUX4Yqx/heEJ2RACfTNi6
6IVau0eKLPOTD+QV38NW5zQ=
=sDzd
-----END PGP SIGNATURE-----

--FL5UXtIhxfXey3p5--