Monitoring cache performance

Call logs contain two types of information about cache performance.

  • Recognizer periodically logs cache hits and miss statistics to the call log using the SWIcach—caching event, for example:
    TIME=20010621173039564|CHAN=006|EVNT=SWIcach|MHIT=245|MMISS=7|
    MSIZE=2025472|DHIT=0|DMISS=7|UCPU=100|SCPU=0

    See Call log event reference for details about event tokens. Logged values show total hits and misses in the memory and disk caches, and can be used to tune cache performance.

    How you use the ratio of cache misses to hits depends on your specific application and grammars. For example, missing small grammars is inconsequential because they take very little time to load from disk cache. Missing dynamic string grammars will be common. If the application reduced the size of the memory cache drastically for some reason, the miss ratio would climb towards 100%. Thus, tuning must be done on case-by-case, and grammar-by-grammar basis. In general, a ratio above 20% would be high for a static grammar, and for tuning purposes you might increase the cache size or increase the minimum-cache-entry size to limit smaller cache entries.

  • The SWIrcnd—recognition end event contains a number of tokens that provide specific, detailed information about the fetch response for particular grammar activations. For a description of those tokens, see Diagnosing delays during grammar loading.