cancel
Showing results for 
Search instead for 
Did you mean: 

Question Ramdisk and data cache for tempdb

Former Member
0 Kudos

Suppose I have ramdisk created at OS level and then created device on it for tempdb within sybase.

Then there are named data cached created and also use data cache to cache tempdb.

Question is: because both are in ram, so if I remove tempdb from data cache binding, should has no impact on performance, right?

Former Member
0 Kudos

Thanks, Mark. then another question about default data cache. If user database is mydb and I create named data cache. then use it for the whole mydb(binding mydb to the cache), then any data for mydb will be cached in the named db, default data cache will no longer related to mydb. Is it right?

Accepted Solutions (1)

Accepted Solutions (1)

former_member182259
Contributor
0 Kudos

You are confusing a number of issues.   First of all, ramdisk and tmpfs are two different drivers in Linux - I think you are using tmpfs.   However, both are memory mapped file systems - in other words, they still act to applications as if physical reads and writes - and to the application, it cannot tell whether the files are on physical disk or not.   So ASE (or any application) has absolutely zero knowledge that you put tempdb in "RAM".....it simply knows that it is attempting AIO to a particular file using a specific filehandle.

Because it is treated just like any other device, ASE will cache data to/from tempdb devices even when on RAM disk - and as Mark (or someone) replied to your earlier post on this topic - ASE will still view this as a physical IO and put the SPID to sleep and poll for IO completion as is standard with AIO.   What this means is:

1) you are double buffering some parts of tempdb in memory - once in ASE data cache and once in filesystem memory.

2) performance is impacted because ALL O/S's have a timeout that once an AIO is posted, you cannot poll for completed until after that time has expired.   Usually not tunable (although Solaris used to be able to)

3) As Mark (or whomever) originally responded to you - tmpfs may be synchronous - and in FACT, using 12.5 (what you are running on) with filesystems, it *will* be synchronous - if you check the errorlog where the /tmpfs devices are opened you will see this - this serializes all IO in tempdb, which could really slow down your system.

4) There were huge issues with filesystem IO on Linux when 12.5 was released - and Linux rewrote their entire AIO stack which required ASE to change how it called AIO in 15.0.1 - you really should upgrade to 15.5+ or 15.7+ to make sure that ASE is compiled for your OS release.

What you REALLY want to do is use IMDB option (15.5) and create an in-memory tempdb.  This eliminates the double buffering, removes the tempdb from default data cache (as you were wondering about), and also does some minor cache optimizations such as eliminating the MRU/LRU - which reduces spinlock contention due to tempdb writes.

You might want to sit down with the latest doc sets and read up on some of these topics - you might want to start with the SysAdmin guides and also look at the specific docs around the features you are looking into - such as the In-Memory Database guide.   The docs are online and can be downloaded as pdf's for offline reading.

Former Member
0 Kudos

thanks for the info. So what ever device is physical or in ram, I/O request always goes to OS.

Then I think the better solution is:

cache tempdb with enough named data cache is better than ramdisk for device.

It means: I can remove ramdisk for OS and get that part of memory for ASE, then create data cache for tempdb.

Is my understanding right?

former_member182259
Contributor
0 Kudos

Only for reads.....physical writes will *ALWAYS* go to the OS.   In addition to the OS problems in 12.5 time era, we also made a TON of changes in temdb in the 15.0 and 15.5 days that dramatically reduced the number of writes in tempdb.

Check out http://www.sybase.com/files/White_Papers/Managing-DBMS-Workloads-v1.0-WP.pdf - particulary the section on tempdb.

Former Member
0 Kudos

Thank you so much, Jeff. So from performance point for ASE 12.5, use memory to cache tempdb is better than put it on ramdisk of OS, right?

Answers (0)