Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2004 23:05:27 +0000
From:      "Lee Harr" <missive@hotmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Read only ram disc.
Message-ID:  <BAY2-F80TwctPBjxPGs00056efe@hotmail.com>

next in thread | raw e-mail | index | archive | help
>       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



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