View Single Post

   
  #8 (permalink)  
Old 04-09-2008, 05:06 PM
bret@sybase.com
 
Posts: n/a
Default Re: Memory Resident TempDB was Re: OK, lets be serious

On Apr 8, 11:53 pm, ThanksButNo <no.no.tha...@gmail.com> wrote:
> Hello, Bret --
>
> On Apr 8, 8:47 pm, b...@sybase.com wrote:
>
> > I believe we are also looking at ways to make tempdb(s)
> > purely memory-resident with no need for disks at all - but the feature
> > isn't here yet.

>
> > -bret

>
> Somebody told me you could set up a ram-disk, and mount the tempdb on
> it.
>
> I tried it without much success. But then, they never told me how it
> was supposed to be accomplished.
>



There is a technote on it at http://www.sybase.com/detail?id=20448

The quick overview is:
You create a tmpfs file system in memory.
You disk init an ASE device onto it.
You make sure the OS is configured so the tmpfs is created on reboot
You modify the RUN_SERVER file to "touch" the ASE device into
existence before starting ASE.
After that, it is usually smooth sailing.



> Someone else told me you could simply install a lot of memory, then
> make a very large cache, then assign said large cache to the tempdb.
> It's not really a "ramdisk", but Sybase should keep things in the
> cache until it's necessary to save it to disk. If the cache is as
> large as tempdb, that need will be very rare. This is supposed to
> have similar performance to a ramdisk.
>
> I've tried this, and it appears to work, although I haven't
> benchmarked it.
>
> Comments?


This is a good approach, and with the new feature in 15.0.2, the need
to write to disk has been reduced.

In both cases, the key is the "when necessary to save to disk". Even
with a ram disk, writing a page from cache to the ram disk takes some
time - even though it is much faster than writing to a hard drive.
And it is using memory for both the data cache used by tempdb and the
tmpfs, which isn't optimal. And currently, even if everything stayed
in cache and was never flushed to disk, the disks do still have to be
out there to create/alter tempb onto. So it would be ideal if
tempdbs could be created solely in memory and never need a
corresponding "disk" to flush to. I think it is doable, but does
require writing special code for handling tempdb.
Reply With Quote