Subject: Re: Any HD size limitations on boot disk?
To: NetBSD Bob <nbsdbob@weedcon1.cropsci.ncsu.edu>
From: Dr. Lex Wennmacher <wennmach@geo.Uni-Koeln.DE>
List: port-pmax
Date: 01/10/2000 17:55:52
On Jan 10, 11:38am, NetBSD Bob wrote:
> Subject: Re: Any HD size limitations on boot disk?
> [...]
> > I always wanted opinions on whether the "async" flag should be specified
here.
> > I use it on some of my systems:
> >      swap /tmp mfs rw,async,-s100000  0 0
> >
> > Theoretically, "async" should be faster. I didn't notice a performance
increase
> > with "async", though, but it didn't hurt either.
>
> What conditions or speed advantage are gained by using mfs vs no mfs?
>
> Where is using mfs most useful and where is it least useful?
>

If you specify the above line in /etc/fstab, /tmp will be a memory file system.
Writes and reads will be a lot faster because they don't nee to be written to a
slow disk. There are numerous applications that create lots of temporary
(usually small) files in /tmp; these applications can considerably be speed up
with a mfs. Other than that, there will be no speed up of your system.

The "async" flags tells mount_mfs that the "write" system call (and others) may
return before they actually wrote all of their buffer. Under normal
circumstances (writing to disk or via network) this causes considerable speed
increase, but "async" writing can make it difficult to recover from crashes
(the application thinks that a record was written which wasn't). The speedup
for an mfs should also exist, but is probably not noticable.

With /tmp being a mfs, you will loose the contents of /tmp across reboots.
"async" doesn't harm here, obviously.

> .....
>
> > >           The 'correct' value for swap is dependent on the usage of the
> > >           system, but a general rule might be the larger of RAM or 32MB.
> > >           Another good rule is to always try to split swap across as many
> > >           disk as possible to increase the available swap bandwidth.
>
> > IMHO, this is too small a value for swap. .....
>
> .....
>
> > My personal decision on swap space is 2.5*RAM, with mfs limited to half of
the
> > swap space.
>
> IFF mfs was not used, would the 32mb swap still be too small?
> I my case, I may want to clone a boot drive as an emergency spare backup.
> In that case, a small 300mb drive would be fine for that.  I could always
> dump onto a larger drive with more swap after the system was brought back up.

Well, I've got a DS5000/240 with 96MB RAM, ande here is what swapctl reports:
(The machine is currently idle)

obelix.geo.Uni-Koeln.DE:~ >swapctl -s
total: 205200k bytes allocated = 4k used,205196k available
obelix.geo.Uni-Koeln.DE:~ >vmstat
 procs   memory     page                       disks   faults   cpu
 r b w   avm   fre  flt  re  pi   po   fr   sr r1 r2   in   sy  cs us sy id
 0 0 0 13580 64468    1   0   0    0    0    0  0  0  334   16   6  0  1 99

So, yes, 32MB can be sufficient.

>
> In your 2.5*RAM mode, are you actually using only 1.25*RAM as swap,
> with mfs operating?

Yes, in case mount_mfs has eaten up half of the swap space (which is not
particularly often the case). My other systems typically have 128 MB RAM.

>
> Good discussion..... lots of neat insights to learn.
>
> Bob

Lex

-- 
Dr. Alexandre Wennmacher
Institut fuer Geophysik und Meteorologie         wennmach@geo.Uni-Koeln.DE
Universitaet zu Koeln                            phone  +49 221 470 - 3387
D-50923 Koeln                                    fax    +49 221 470 - 5198