Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Feb 1996 10:40:27 -0500 (EST)
From:      jlrobins@zappa.cs.uncc.edu (James Robinson)
To:        Duncan.Barclay@pa-consulting.com (Duncan Barclay)
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Swap adding daemon
Message-ID:  <9602061540.AA13100@zappa.cs.uncc.edu>
In-Reply-To: <31178897@SMTPGATE.PA-CONSULTING.COM> from "Duncan Barclay" at Feb 6, 96 08:47:00 am

next in thread | previous in thread | raw e-mail | index | archive | help
> I am going to write a daemon to keep an eye on the ammount of swap used
> and add extra to the system using the vn driver. if a threshold is crossed.
> I ensivige this to be useful to people with home machines which are rebooted
> most days and dont always need loads of swap space. The swap files
> created would be deleted on the next reboot by rc or as part of the daemon
> configuration.

Good idea! And if the ability comes to unswap from a device, then it could
do that too! Sortof of an amd for swap.

> 
> Questions:
>      Has anyone done it before.
> 
>      Would a fstab like config script be better than
>      automatically finding spare vnodes in /dev and
>      allocating space.
>      ie.
>      #file               vnode          size threshold
>      #                             to create on
>      /usr/tmp/swapfile1  /dev/vn0a 12M  80%
>      /usr/tmp/swapfile2  /dev/vn0b 12M  80%
>      /disk2/tmp/swapfile /dev/vn0c 24M  90%
>      where the threshold is the percentage of currently used swap.

Hmm. fstab syntax is the way to go. I assume that the system, in this case,
would add /usr/tmp/swapfile1, after creating it to be 12M, first, once the
system exceeds 80% swap capacity. Then, after some time, swapfile2 is
joined in after the previously augmented swap space exceeds 80%. Etc.
> 
>      Should the swap usage be looked at over a long time to determine
>      threshold or be faily reactive?

Hmm, since we can't remove swap at this moment in time, I'd lean towards
the more conversative.

What two threshold fields, one to specify 5 minute avg swap usage, and the other
to specify one minute swap usage? So, it would add that space if the
one minute swap load reading exceeded 95%, or add it if the 5 min swap load
average exceeded 75%. This would handle a heavy swap hog (netscape, anyone?),
or a general increase in load over time.

Just my $.02 -- good idea! Heck, you could prototype it in a script language.



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