From owner-freebsd-questions@FreeBSD.ORG Tue Apr 20 17:07:59 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0836016A4CE for ; Tue, 20 Apr 2004 17:07:59 -0700 (PDT) Received: from hotmail.com (bay2-f80.bay2.hotmail.com [65.54.247.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE9FF43D41 for ; Tue, 20 Apr 2004 17:07:58 -0700 (PDT) (envelope-from missive@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 20 Apr 2004 16:05:30 -0700 Received: from 208.186.54.187 by by2fd.bay2.hotmail.msn.com with HTTP; Tue, 20 Apr 2004 23:05:27 GMT X-Originating-IP: [208.186.54.187] X-Originating-Email: [missive@hotmail.com] X-Sender: missive@hotmail.com From: "Lee Harr" To: freebsd-questions@freebsd.org Date: Tue, 20 Apr 2004 23:05:27 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 20 Apr 2004 23:05:30.0202 (UTC) FILETIME=[F9D8ABA0:01C4272B] Subject: Re: Read only ram disc. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 00:07:59 -0000 > I am looking at ways to speed up file reads one a server thats >running >FreeBSD 5.2.1 and was wondering if there is a way to setup some kind of >read only ram disc for a directory and its contents. What i want to do >is the following: > > 1. Specify a directory (e.g. /usr/local/www/data) > 2. Specify the max size of the ram disc. > 3. If a read request for a files is issued then: > a. Load the file into the ram disc if it dosent already >exist. > b. If it exists and the file on disc hasn't been updated >then get the >contents from the ram disc. If the file has changed then do step a. > 4. If a write request for a file is issued then the request is made >directly on the disk and the file in the ram disc is removed or updated. > > Is there a way to do this? And would the read speed up be worth it >(the >application is very read intensive)? > My understanding is that this is just about how the FreeBSD VM (virtual memory) system works already. Basically, once a file is read, it is held in memory until other files (newer, more recently used, more frequently used) are needed and push it out of memory. _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail