Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2006 10:57:46 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Marcin Koziej <creep@desk.pl>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Poor swapping performance -- lot's of unused free memory.
Message-ID:  <20060622155746.GL9539@dan.emsphone.com>
In-Reply-To: <449A8834.10902@desk.pl>
References:  <449A8834.10902@desk.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 22), Marcin Koziej said:
> I use FreeBSD 6.1-STABLE #0: Mon Jun 12 18:00:56 CEST 2006 for a
> desktop (Launch several apps at the start and mostly nothing else,
> except when compiling). I've got 512 MB of ram.
> 
> From some time, I've noticed poor swapping performance -- this can be
> very annoying when memory needs to be swapped in and the whole
> systems chokes on disk I/O. Most frequently when launching a big
> application or clicking on recently not used application window.
> 
> What I notice, is that top(1) reports: 60 MB free, and 150 MB on the
> swap, which means these 60 mb are just sitting there doing nothing. I
> remember in older versions of FreeBSD tried to keep swap as little
> used as possible, leaving 3-4 mb ram free. This is just a feeling, of
> course, but it feels like it's slower now.

That 60MB might be free due to a large process that recently exited;
you'd have to run top for a while and see what the trends are.  Note
that if you're asking for freebsd to pre-emptively pull some stuff back
into RAM from swap, there's no way for the OS to know which blocks will
be needed, if any.  That 150MB swap might be truly unused data in
long-lived processes that will never get swapped back in, in which case
it's better for the system to leave that 60MB alone, for disk cache or
memory for new processes.
 
> Can anybody comment on this? Maybe there is a sysctl which can tune
> this ? (I've searched for such, but found nothing).

Putting swap on a different disk from the rest of the OS should help.
It's probably jumping between the swap partition and your filesystem,
alternately paging in private data from swap and shared
library/executable code from /usr.

-- 
	Dan Nelson
	dnelson@allantgroup.com



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