问题
I'm using an AWS DAX cluster of 3 nodes of dax.r4.xlarge node type. When I'm running my spark application from EMR cluster, it is always fetching values from dynamodb table. Even if I run the same application on same set of key, it is querying dynamodb table. In the DAX cluster metrics I see 0 cache hits and misses.
回答1:
I found the mistake. Initially I was hitting DynamoDB directly and was using consistent reads by defining get item input parameter as:
ConsistentRead: aws.Bool(true)
When I switched to DAX client, I did not remove it. Hence it was always redirecting all the requests to Dynamodb table to keep the reads consistent.
Removing this worked. I can see cache hits and misses in DAX metrics now.
来源:https://stackoverflow.com/questions/60415133/aws-dax-cluster-has-zero-cache-hits-and-cache-miss