Sybase Brand Color Bar
delete

Search for    in all of Sybase.com
view all search results right arrow
  blank
Support > Technical Documents > Document Types > Technote > Using Solaris tmpfs for a tempdb Device

Using Solaris tmpfs for a tempdb Device

Using a tmpfs device for tempdb may be beneficial, especially if your Sybase server is near the addressable memory limit.
 
RSS Feed
 
 
 

Background

Adaptive Server devices usually are raw devices or file system devices. Solaris users have a third option, tmpfs, for tempdb.

tmpfs -- the temporary file system -- caches writes only for a session. Files are not preserved across operating system reboots.

Note:

Other UNIX platforms may allow you to create a temporary file system device. See your operating system System Administrator.

Should you use tmpfs?

To determine whether tmpfs would benefit your system, perform benchmarks comparing the memory assigned to tmpfs versus the memory assigned to the data cache.

Usually, it is more effective to give extra memory to the server for use as general data cache rather than creating a tmpfs device for tempdb. If tempdb is used heavily, then it will use a fair share of the data cache. If tempdb is not used often, then the server can use the memory assigned to data cache for non-tempdb data processing, but if the memory is assigned for tempfs it is wasted.

Servers that are most likely to benefit from using tmpfs are those that are already near the addressable memory limit:

Addressable memory in Adaptive Server 11.9.3 generally is 4TB, and therefore tmpfs may not be as beneficial.

Creating a tmpfs device

Follow these steps:

  1. Create and test an operating system startup script that creates tmpfs after every operating system reboot. See the Solaris man page on tmpfs for details on creating a tmpfs filesystem.

  2. Create the tmpfs device with disk init just like creating any other filesystem device, except that you are specifying the tmpfs filesystem you just created. For example, if you named and mounted it as "/mytmpfs":

    1> use master
    2> go
    
    1> disk init name = "tempdb1_dev1", 
    2> physname = "/mytmpfs/tempdb",
    3> vdevno = 3, size = 102400
    4> go

    This creates a 200MB device for tempdb on the /mytmpfs device.

  3. Use alter database to extend tempdb to the tmpfs device:

    1> alter database tempdb 
    2> on tempdb1 = 200
    3> go
  4. Modify your RUN_Server file to issue a UNIX touch command against tempdb on the tmpfs device before the call to the dataserver. This creates the file if it does not exist, as might happen if the operating system had been rebooted. Upon startup, the server can activate the device and rewrite tempdb. If the file entry was missing, the server would not be able to activate it and tempdb would not be available. For example:

    RUN_SYBASE:
    ----------------------------------------------
    #!/bin/sh
    #
    # Adaptive Server name: SYBASE
    # Master device path:   /devices/master.dev
    # Error log path:       /sybase/install/SYBASE.log
    # Directory for shared memory files:    /sybase
    #
    
    touch /mytmpfs/tempdb_dev1
    
    /sybase/bin/dataserver -sSYBASE -d/devices/master.dev \
    -e/sybase/install/SYBASE.log -M/sybase \


 

DOCUMENT ATTRIBUTES
Last Revised: May 21, 1999
Product: SQL Server Monitor, Adaptive Server Enterprise
Technical Topics: Database Admin, Performance & Tuning
  
Business or Technical: Technical
Content Id: 20448
Infotype: Technote
 
 
 

© Copyright 2010, Sybase Inc. - v 6.7 Home / Contact Us / Sitemap / Help / Feedback / Jobs / Legal / Privacy / Code of Ethics Follow Sybase