Sybase Procedure Cache Test

Adaptive Server maintains an MRU/LRU (most recently used/least recently used) chain of stored procedure query plans. As users execute stored procedures, Adaptive Server looks in the procedure cache for a query plan to use. If a query plan is available, it is placed on the MRU end of the chain, and execution begins. If no plan is in memory, or if all copies are in use, the query tree for the procedure is read from the sysprocedures table. It is then optimized, using the parameters provided to the procedure, and put on the MRU end of the chain, and execution begins. Plans at the LRU end of the page chain that are not in use are aged out of the cache.

The memory allocated for the procedure cache holds the optimized query plans (and occasionally trees) for all batches, including any triggers. If adequate memory is not available to the cache, then cache misses will increase, thereby causing direct accesses to database tables to rise; if this trend continues, then the performance of the database server will suffer. 

By periodically monitoring the usage of the procedure cache, administrators can promptly detect insufficient memory allocations to the cache; based on the findings, they can resize the cache to ensure peak performance of the database server.

This test reports whether/not the procedure cache has been utilized optimally. For execution, the test requires the enable monitoring configuration parameter to be enabled.

Target of the test : A Sybase ASE server on which the MDA tables have been installed

Agent deploying the test : An internal agent

Outputs of the test : One set of results for every Sybase ASE server being monitored.

Configurable parameters for the test
Parameter Description

Test Period

How often should the test be executed.


Refers to the IP address of the Sybase ASE server.


The port number at which the Sybase server listens to.


To enable this test to connect to the Sybase server and collect the required metrics, it is enough if you configure the test with the name of a Sybase user who has the “mon_role”. However, for best results, it is recommended that you configure all Sybase tests with the credentials of a Sybase user who has the “mon_role”, “sa_role’, and “sybase_ts_role”.


The password corresponding to the above user

Confirm Password

Confirm the password by retyping it here.

Detailed Diagnosis

To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

  • The eG manager license should allow the detailed diagnosis capability
  • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
Measurements made by the test
Measurement Description Measurement Unit Interpretation

Procedure hit ratio

The percentage of time a stored procedure query plan required by a user was available in the procedure cache.


Ideally, the value of this measure should be high. A low value indicates that many stored procedure query plan that users required were, more often than not, unavailable in the procedure cache. To ensure that accesses to physical database tables do not increase as a result, check the most accessed procedure and place it in named cache.

A low cache hit rate could also indicate a badly sized cache. Use the detailed diagnosis of this test to view the top-5 procedures in the cache in terms of memory usage.

If need be, you can resize the cache using the following formula:

max # of concurrent users ) * (4 + size of largest plan ) * 1.25