Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Nov 2000 21:09:44 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        "Amit Tantia" <amit@tallysolutions.com>
Cc:        questions@freebsd.org
Subject:   Re: Ram Disk Drivers
Message-ID:  <14885.50424.124578.866464@guru.mired.org>
In-Reply-To: <76973342@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Amit Tantia <amit@tallysolutions.com> types:
> Hello,
> 
> I have an free bsd 4.1.1 running on my system with Apache...and I have an
> AMD K6 with 400 mbs ram...I am looking out for a ram disk driver for our
> system
> 
> Normally, when you write out to a file the operating system has disk drivers
> which write the data out to a physical disk. Some programmers have written
> drivers that use memory and make that memory look like a hard drive to the
> operating system. This means when you read file from the disk the read
> happens VERY VERY quickly (much faster than reading from a hard drive).
> 
> If any one can help me with locating the best source of for a ram disk
> driver...I would be very grateful.

You want md. It's limited to a 10 meg disk (may vary with
version). Mfs doesn't have that problem, but it's backed by swap so
that if you run out of memory, you wind up writing to disk *anyway*.

Of course, your initial assumption (that writing out to a file has to
wait for disk) is false, thanks to buffer caches. On writes, the
system just copies the data to a memory buffer and returns, and the
write to disk will happen later. A memory disk will be faster for a
number of reasons. On the other hand, if you're short of real memory,
the space you set aside for md may be just enough to push your
software into thrashing, in which case it will be a *lot* slower.

In other words, things are not as simple as they look. You should
*measure* your performance on all three kinds of disk, with various
mount options (soft updates comes very much to mind, as does async -
which soft updates disables).

	<mike
--
Mike Meyer					http://www.mired.org/home/mwm/
Independent WWW/Unix/FreeBSD consultant,	email for rates.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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