From owner-freebsd-questions Wed Nov 29 19: 9:52 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 241BE37B401 for ; Wed, 29 Nov 2000 19:09:50 -0800 (PST) Received: (qmail 15412 invoked by uid 100); 30 Nov 2000 03:09:44 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14885.50424.124578.866464@guru.mired.org> Date: Wed, 29 Nov 2000 21:09:44 -0600 (CST) To: "Amit Tantia" Cc: questions@freebsd.org Subject: Re: Ram Disk Drivers In-Reply-To: <76973342@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Message: You should get a better mailer. Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Amit Tantia 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).