Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2002 14:02:05 -0800
From:      Tim Kientzle <kientzle@acm.org>
To:        stable@FreeBSD.org, marius@malkav.snowmoon.com
Subject:   Re: memory disks in 4.5-stable
Message-ID:  <3DFA58DD.50001@acm.org>

next in thread | raw e-mail | index | archive | help
> I want to create a number of small RAM disks on some webservers so they
> can serve high traffic content directly off of RAMdisks instead of
> conventional disks or NFS.


I would strongly suggest you do some load-testing before
you do this on a production machine.  Otherwise, you
might waste a lot of time on something that gives you
no performance benefit at all.  (In fact, naive use of
RAM disks can significantly impair overall performance.)
Make sure that your test machine is as close as possible
to your production configuration: same RAM, same disk,
same CPU, same NIC.  (If your production environment uses
NFS, use NFS in your test environment.)

Copying data to a RAM disk is just an attempt to manually
cache data in RAM.  Generally speaking, the kernel is pretty
smart about deciding what is best to keep in RAM.  It
will use spare memory as disk cache.  (If it has spare
memory; just adding memory might help.)  If the bulk
of your traffic is a few tens of MB of data from a local disk,
that data will generally end up being kept in RAM
anyway; a RAM disk won't help.

NFS is a slightly different story, though.  Because of
the nature of NFS, the kernel is not allowed to be as
aggressive about caching data in RAM.  Copying NFS content
to a local hard disk can be a big speedup because the
kernel can then do more aggressive disk caching.
(Although, sometimes it works the other way around;
a cheap local disk can actually be slower than a
well-tuned RAID array accessed over 100Mbps or 1Gbps
Ethernet.)

Like I said, you should test very carefully before
using this approach in production.

Tim Kientzle


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




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