Adjusting the Default Named Cache Size in the RAPCache

Adjust the default named cache size to use as much memory as can be spared by the system ASE is running on.

Adjusting the default named cache size increases RAPCache performance as an in-memory database. The amount of shared memory available to ASE determines the following configuration variables:
max memory
default data cache

The value for max memory should be the maximum amount of shared memory available on your system. The amount of shared memory available is generally controlled by operating system configuration, and will likely need to be modified before a usable RAPCache can be properly configured.

The amount of memory to reserve for shared memory is dependent on total memory available on your system. The maximum amount of memory should be allocated for shared memory, but enough memory should be retained for use by the various processes that will be running on the system. For example, if a system is dedicated to the RAPCache and RAPCache Subscriber, and has a total of 32 Gigabytes of memory (RAM), then approximately 28-30GB of operating system shared memory should be configured.

Once the operating system shared memory has been configured, then the RAPCache can be configured to use it. This is done by first configuring 'max memory' to the total amount of shared memory available on your system, and then by configuring the default data cache.

Data cache size will be dependent on the max memory configuration value. Use as much memory as can be spared, given the system on which ASE is running. This depends on value of max memory. If max memory is 16GB, allocate 15GB for data cache; the rest is to be used for proc cache, RAPCache system memory usage, etc.

When configuring default data cache size, it is also best to partition the cache, so that access to the cache from multiple engines does not cause contention. The partition count should equate to the number of engines, but has to be specified in powers of two. For example, if you have configured 6 engines, then the cache partition count should be set to 8.

Here is an example of a SQL script used to configure max memory to 16GB, and to configure default data cache with 15 gigabytes of memory, and 8 cache partitions:
sp_configure 'max memory', 8000000 -- 8 million 2k pages = 16GB
go
sp_cacheconfig 'default data cache', '15G', 'cache_partition=8'
go


Created April 9, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com