Understanding DXcache (i.e. 'get cache;' output)

Document ID : KB000053894
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This document describes the meaning of 'get cache;' output when run from DXconsole. This will give you brief explanation of what each parameter and it's value mean, that you see in the output.

Solution:

Purpose:

Understand the various parameters from 'get cache;' output when run via DXconsole while troubleshooting performance issues with DXcached DSA; t he most common solution of which would be to restart your DXcached DSA to reload the cache back into the system memory to get optimal performance.

Example:

When running 'get cache' from DXconsole you will see the following output:

Dsa>get cache;

All entries loaded
Number of Entries 16992
Memory used by cache: 79965112 out of 89646589
(Memory initially used by data only: 65744156)
Memory leaked 536

Number of Cache Hits 214
Number of Cache Misses 1
Number of Sequential Scans 0
Free lists:
EntryLists: 80016
Constrained values: 49488
Unconstrained values: 19440
IndexList: 0

Dsa>

The above output is based on cache size set to 1600 MB. i.e. "set max-cache-size=1600;" defined within the DSA initialization (.dxi) file. This sets the maximum amount of memory used by DXcache to 1600 MB.

Some basic information:

For performance improvement DXcache requests memory in blocks and manages it itself. This is because requesting and freeing memory is an expensive O/S operation. When a value is deleted from DXcache, instead of freeing it, DXcache adds to its own 'free' list due to the fact that other areas of the block may still be in use. When information is added, the 'free' list is scanned and if a slot is found that is an exact/close fit then it will be used. The fragment of memory left over from the allocation is reported as 'memory leaked'.

For example, if the value "John Smith" is removed this will leave 11 bytes of free memory. If the value "Fred Gill" is then added there will 2 bytes leftover and reported as memory leaked.

Meaning of each parameter displayed above:

Number of Entries 16992
This is the total number of entries that is loaded within DXcache when the DSA is started.

Memory used by cache: 79965112 out of 89646589
(Memory initially used by data only: 65744156)

These are all reported in bytes.

The first statement is the number of bytes of memory currently used out of the currently allocated memory size (e.g. 79MB used out of 89MB allocated).

Key factor to keep in mind here is that, DSA calculates how much total of 1600MB (that we defined) is required for the initial load. In the example above, it is 89MB out of 1600MB. 1600MB is the limit that we define in .dxi file. During the startup of DSA, if the total requirement exceeds 1600MB then the DSA will fail to start.

The second statement is the size, in bytes, of the raw data being cached without taking into account the additional overhead of indexing and other.

Memory leaked 536
This is also reported in bytes.
It is not a bad thing, it is just memory that may not be able to be reclaimed until a cached value is modified or the cache is restarted.

The value of memory leaked will fluctuate over time but will remain a very low percentage of memory used by DXcache and is little overhead compared with the performance gain. In short "This number represents a value block from a free-list is re-used that is larger than the value being added."

Number of Cache Hits 214
This is the number of requests serviced by the cache.

Number of Cache Misses 1
This is the number of cache misses the search that loaded the cache.

Number of Sequential Scans 0
This represents the value of the outcome of: If the search filter does not match the defined cache-index and the item is defined in cache-attrs, then the cache will be scanned to service the request.

e.g.
cache-index = commonName
cache-attrs = surname
search <blah> filter = (surname=Smith)

Free lists:
For memory efficiency the DSA will move deleted cache elements to the free lists.

EntryLists: 80016
Removed entry blocks to be used when new entries are added.

Constrained values: 49488
Removed values of a fixed (small) size to be used when values are added.

Unconstrained values: 19440
Removed values larger than constrained values to be used when values are added.

IndexList: 0
Cache index blocks available for re-use when values are added.