Configuring Spinlock Ratio Parameters

Spinlock ratio parameters specify the number of internal system resources such as rows in an internal table, or cache, that are protected by one spinlock.

A spinlock is a simple locking mechanism that prevents a process from accessing the system resource currently used by another process. All processes trying to access the resource must wait (or “spin”) until the lock is released.

Spinlock ratio configuration parameters are meaningful only in multiprocessing systems. An SAP ASE configured with only one engine has only one spinlock, regardless of the value specified for a spinlock ratio configuration parameter.

This table lists system resources protected by spinlocks and the configuration parameters you can use to change the default spinlock ratio.

Configuration Parameter

System Resource Protected

lock spinlock ratio

Number of lock hash buckets

open index hash spinlock ratio

Index metadata descriptor hash tables

open index spinlock ratio

Index metadata descriptors

open object spinlock ratio

Object metadata descriptors

partition spinlock ratio

Rows in the internal partition caches

user log cache spinlock ratio

User log caches

The value specified for a spinlock ratio parameter defines the ratio of the particular resource to spinlocks, not the number of spinlocks. For example, if 100 is specified for the spinlock ratio, SAP ASE allocates one spinlock for each 100 resources. The number of spinlocks allocated by SAP ASE depends on the total number of resources as well as on the ratio specified. The lower the value specified for the spinlock ratio, the higher the number of spinlocks.

Spinlocks are assigned to system resources either in a round-robin manner, or sequentially: