Subject: Re: paging like crazy
To: NetBSD-current Discussion List <current-users@NetBSD.ORG>
From: Jukka Marin <>
List: current-users
Date: 09/01/2001 20:13:00
On Sat, Sep 01, 2001 at 02:03:31AM -0400, Greg A. Woods wrote:
> > Isn't there REALLY a way to limit the amount of RAM used by the disk buffer
> > cache?
> I've noticed a slight difference improvement since adding the following
> to my config:

Thanks, I'll experiment with those.

> However I didn't really find it all that bad beforehand either.  Sure
> sometimes Netscape or Mozilla would take a while to page in (on the
> order of 5-10 seconds, not bad for a 24 to 64MB process!), but my next
> biggest interactive processes (emacs) would normally be front&centre all
> the time (maybe because I load the time package and have the current
> time displayed in my mode line, which means emacs must wake up to do
> that).

Well, if I use ps after a backup, I see that every process (which is
sleeping) has only 4K of resident space and the rest is on the disk.

> It helps a lot too if you've got lots of swap spindles.  I've got 4
> UltraFAST+wide (40MB/s) drives with a 500MB swap partition on each, so
> when this system does page, it pages FAST!

Well, this is an X terminal (sort of) and has only one disk.

> Of course I don't run X11 directly on this machine -- it's a server, not
> a workstation.  I run my X11 on X terminals and a diskless sparcstation.

I have no problems with my server.  I don't use it for interactive work.

> > After a full backup, _everything_ has been paged to disk and a 900 MHz
> > Athlon with 384 MB RAM is much slower than a 50 MHz 486 with 16 MB and
> > an older version of NetBSD.
> Well, what do you expect?!?!?!  You're asking the system to do a *lot*
> of I/O before it can do anything else.  You also more or less asked to
> have everything paged out because you weren't demanding that the paged
> out processes run actively while the backup was running.  The system is
> simply doing its best to do what you've asked it to do, given the
> resources you've given it, and the configurations you've assigned.  If
> you have to page in 300 MB of stuff from a single spindle you'd best be
> prepared to sip your coffee patiently while it does its best to do so!

Well, I have never asked the system to be as stupid as that.  It's OK for
the machine to use any unused RAM as disk buffers - but the memory occupied
by my interactive programs is _not_ _unused_ memory.  The backup data is
read only once, it makes no sense to flush everything else from RAM just to
fill it with one-time data which is no longer useful in RAM after that
single occasion.  It also makes no sense using all RAM for buffers to
"speed up" things - at the expense of the processes which _also_ need RAM
to do their work (and process the data that fills up all RAM).

Just let me set the maximum amount of RAM that is _ever_ allocated to
buffers and I'll be happy.  If I set it to 128 MB, I want the rest of
the RAM be devoted for running my processes.  If there _is_ such a limit,
it doesn't seem to work.  Otherwise, I would still have most processes
in RAM after a backup.  In the 1.4 days, the system felt much more 
responsive (although I was running on much smaller systems that time)
because there was nothing forcing all processes off the memory to slow
swap space.

As it is now, I guess having _less_ RAM might actually make things faster.
At least it would keep the machine from doing 300+ MB's worth of stupid
things as it's doing now.. :-I

Sorry, but I _really_ don't like the current behavior - no matter how
nice and fine the buffer cache may be.

Let my processes have their RAM! ;-)