Cassandra 密钥缓存为空

发布于 2024-12-22 04:24:46 字数 392 浏览 7 评论 0原文

我是 Cassandra 的新手,我正在尝试优化我的读取(写入时间很好,大约每 0.1 秒 1000 行),并且我一直在阅读键缓存和行缓存。

使用 Java 和 Hector 库插入数据似乎一切都很顺利,但读取速度确实很慢(比我所比较的 SQL Server 实例慢大约 2-3 倍)。我开始查看 cfstats 显示的统计信息:

Key cache capacity: 200000
Key cache size: 0
Key cache hit rate: NaN
Row cache capacity: 40000
Row cache size: 0

插入后键或行缓存中不应该有一些东西吗?我想这就是为什么当我尝试阅读时它运行得如此缓慢。

任何帮助将不胜感激...

I'm new to Cassandra and I'm trying to optimize my reads (write time is fine, about 1000 rows per .1 seconds) and I'm been reading up on the Key cache and Row cache.

Using Java w/ the Hector library to insert the data everything seems to go fine but the reads are really slow (about 2-3x slower than a SQL Server instance I'm comparing against). I started looking at the stats ad cfstats shows:

Key cache capacity: 200000
Key cache size: 0
Key cache hit rate: NaN
Row cache capacity: 40000
Row cache size: 0

Shouldn't there be something in the Key or Row cache after the insert? I think that is why it is running so slowly when I try to read.

Any help would be appreciated...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

脱离于你 2024-12-29 04:24:46

键缓存仅用于从磁盘上的 sstable 读取数据。如果您正在查询的数据最近已插入或更新,则会从内存表中读取数据,并且不会填充键缓存。

The key cache is only used for data read from on-disk sstables. If the data you're querying has been inserted or updated recently, it will be read from the memtable instead and the key cache will not be populated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文