On Mon, Nov 10, 2003 at 05:03:35PM +0100, Harald Fuchs wrote:
> In article <[EMAIL PROTECTED]>,
> gerald_clark <[EMAIL PROTECTED]> writes:
> 
> > Matt W wrote:
> 
> >> Hi Jeremy,
> >> 
> >> Sorry, it seems like I'm saying this a lot lately. Is it not true that
> >> if the whole table will fit in [free] RAM, that the OS will cache the
> >> file data and there is no need for a RAM disk. I don't really see how
> >> performance would be any different than using a RAM disk. Either way,
> >> you will still have the overhead of the filesystem calls, even if data
> >> isn't actually read from disk, unlike with a HEAP table.
> >> 
> 
> > Just because a file is in the cache now, it doesn't follow that it
> > will be in the cache 5 minutes from now.
> 
> If it gets thrown out of the FS cache, you don't have enough RAM, and
> then a ramdisk won't help much.

A ramdisk can help even when you have "enough" RAM.  Sometimes the OS
isn't smart enough to know not to cache something that doesn't need
caching, and can clear out data you wouldn't want it clearing out.
Perhaps someone does a full table scan of a large table once in a
while, or whatnot.  (Maybe someone copies a db backup file from the
machine, and in the process wipes out the cache.)  A ramdisk makes
sure the disk is never hit, effectively locking the pages in a type of
cache.  (Hopefully OSs are smart enough not to further cache ramdisk
pages.)

I haven't used a ramdisk in a db server yet; I don't have any one
table that simply MUST be read out of memory every time, and the OS
does a pretty good job of managing things.  YMMV.

--Pete

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to