Skip to content
Advertisement

What are “Positive entries” and “Negative entries” in NSCD (Named Service Cache Deamon) for FreeIPA

The “Positive entries” and “Negative entries” stats are in the nscd -g command under “hosts cache” section. From the nscd.conf manual, I see that “positive entries are successful queries in the specified cache” and “negative entries (unsuccessful queries) in the specified cache”. But, how can a unsuccessful query(negative entry) in cache have hits(cache hits on negative entries), when the query itself means it can’t find the value in cache… Can’t understand the difference between those two.. Can some please explain them in simple terms?

{code}

JavaScript

{code}

Advertisement

Answer

nscd has nothing to do with FreeIPA.

Positive cache entries are the ones that were found to exist and can be cached for longer time as it is assumed that they would not change so often.

Negative cache entries are the ones that were found to not exist at the source for some reason and this fact is cached for shorter time. The reason for negative caching is to avoid excessive load on the source as that might be more time and effort consuming than for positively cached entries. For example, one might get a negative cache entry due to an operation timeout. Repeating the same request in short amount of time would cause each of these operations to time out. Negative cache allows to answer these requests from cache over the cache TTL (the result would be ‘entry does not exist’) but then retry again to retrieve the data from the original source once TTL is expired for a negative cache entry.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement