eG Monitoring
 

Measures reported by HdpNnRetCachTest

The NameNode uses a retry cache to prevent the failure of non-idempotent operations (e.g., create, append, and delete). If retry caching is enabled on the NameNode, then the NameNode tracks previously received non-idempotent requests based on the ClientId and CallId of the requests,and stores the corresponding responses in the cache. Sometimes, a request may be completed, but the client may not have received the response for some reason. If such a client retries the request, the response is served from the retry cache.

Administrators can allocate heap memory to the cache for storing the responses. To optimize memory usage, administrators can also configure how long entries can 'live' in the cache, before they expire. If these configurations are not set prudently, then the retry cache may not be able to serve client retry requests, thus causing such requests to fail.

To avoid this, administrators must continuously monitor the usage of the retry cache, promptly spot any sudden/steady decrease in hits to the cache, and promptly figure out what could be the cause of poor cache usage. This is where the HdpNnRetCachTest test helps!

This test tracks retry requests to the NameNode and reports the rate at which these requests are served by the retry cache on the node. In the process, administrators can figure out whether/not the cache is being used optimally. The test also tracks the count of entries that are cleared from the cache from time to time. With the help of this metric, the administrator can figure out if the expiry period of the cache entries has been correctly set.

Outputs of the test : One set of the results for the Hadoop cluster being monitored

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
Retry_cache_cleared Indicates the number of entries that were cleared from the retry cache during the last measurement period. Number If the value of this measure remains consistently high, it is a cause for concern, as it indicates that many entries are cleared from the cache during each measurement period. If many responses are cleared from the cache at frequent intervals, the likelihood of a retry request not finding a match in the cache is very high. This can increase cache misses, which in turn can cause retry request failures.

To avoid this, you may want to relook at how long you have configured entries to be retained in the cache. If the retention period configured is very short, then naturally, entries will be frequently cleared from the cache. As a result, a few latest responses may also be cleared from the cache. In this case, if the client retries a request, the request may not find a corresponding response in the cache. This can cause the request to fail.

To prevent this, you can increase the retention period of cache entries by editing the value of the dfs.namenode.retrycache.expirytime.millis parameter in the hdfs-default.xml file.
Retry_cache_hit Indicates the rate at which client retries are serviced by the retry cache. Hits/Sec A high value is desired for this measure, as it is indicative of a healthy retry cache and optimal cache usage. If this value steadily decreases, it could imply that the cache is unable to service many of the retry requests. The probable reasons for this and their possible resolutions are detailed below:

  • The cache is poorly sized: If adequate heap memory is not allocated to the cache, then the cache will not be able to store many entries within. As a result, it may not be able to service retry requests effectively. In such a situation, you may want to consider allocating more heap memory to the retry cache. For that, increase the percentage value configured against dfs.namenode.retrycache.heap.percent in the hdfs-default.xml file.

  • The cache is configured with a short retention period: If the retention period configured is very short, then naturally, entries will be frequently cleared from the cache. As a result, a few latest responses may also be cleared from the cache. In this case, if the client retries a request, the request may not find a corresponding response in the cache. This can cause the request to fail. To prevent this, you can increase the retention period of cache entries by editing the value of the dfs.namenode.retrycache.expirytime.millis parameter in the hdfs-default.xml file

Retry_cache_updated Indicates the rate at which the retry cache was updated. Updates/Sec