cassandra - Cassandra 行缓存和分区键缓存的区别

标签 cassandra

行缓存和分区键缓存有什么区别?我是否需要同时使用两者以获得良好的性能视角。
我已经阅读了 dataStax 网站的基本定义

The partition key cache is a cache of the partition index for a Cassandra table. Using the key cache instead of relying on the OS page cache saves CPU time and memory. However, enabling just the key cache results in disk (or OS page cache) activity to actually read the requested data rows.

The row cache is similar to a traditional cache like memcached. When a row is accessed, the entire row is pulled into memory, merging from multiple SSTables if necessary, and cached, so that further reads against that row can be satisfied without hitting disk at all.


任何人都可以详细说明使用领域。确实需要两者都实现。 ?

最佳答案

TL;DR:您想要使用 Key Cache,但很可能不想要行缓存。

key 缓存帮助 C* 了解特定分区在 SStables 中的开始位置。这意味着 C* 不必读取任何内容来确定文件中的正确位置以开始读取行。这对几乎所有用例都有好处,因为它通过潜在地消除读取路径中对 IOP 的需求而大大加快了读取速度。

行缓存有一个更有限的用例。行缓存将整个分区拉入内存。如果该分区的任何部分已被修改,则该行的整个缓存都将失效。对于大分区,这意味着缓存可能会频繁地缓存大块内存并使大块内存失效。因为您确实需要大部分静态分区才能使其有用,所以对于大多数用例,建议您不要使用行缓存。

关于cassandra - Cassandra 行缓存和分区键缓存的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25079311/

相关文章:

linux - 节点上的多少负载太多了?

长行的 Cassandra 性能

Cassandra-Stress 因错误而停止

python - 将 Thrift 协议(protocol)与 Datastax Python 驱动程序结合使用

cassandra - CQL-在 SELECT 语句中组合两个字段

timeout - Cassandra 频繁读写超时

java - Apache Spark 无法处理大型 Cassandra 列族

hadoop - 无法找到分区程序类 - Cassandra

cassandra - Cassandra 中的列排序

full-text-search - 键值存储数据库是全文搜索存储的好选择吗?