我是 NoSQL 和 Cassandra 的新手。我正在尝试设置以实现仅内存缓存的解决方案。我正在通过从 100000 行文件中逐行读取并使用 Hector 插入到 Cassandra 来进行处理。我注意到每秒大约 6000 次插入的吞吐量非常低。整个写操作大约需要 20.5 秒,这对我们的应用程序来说是无法接受的。我们需要每秒 100000 次插入。我正在使用 4GB RAM 的 Windows 7 计算机上进行测试。
我正在做一个仅插入测试。
请让我知道我哪里出错了。请建议我如何提高每秒插入次数。
Keyspace: Keyspace1
Read Count: 0
Read Latency: NaN ms.
Write Count: 177042
Write Latency: 0.003106884242157228 ms.
Pending Tasks: 0
Column Family: user
SSTable count: 3
Space used (live): 17691
Space used (total): 17691
Number of Keys (estimate): 384
Memtable Columns Count: 100000
Memtable Data Size: 96082090
Memtable Switch Count: 1
Read Count: 0
Read Latency: NaN ms.
Write Count: 177042
Write Latency: NaN ms.
Pending Tasks: 0
Key cache capacity: 150000
Key cache size: 0
Key cache hit rate: NaN
Row cache capacity: 150000
Row cache size: 0
Row cache hit rate: NaN
Compacted row minimum size: 73
Compacted row maximum size: 924
Compacted row mean size: 784
我尝试了几种设置行缓存和键缓存的方法:
通过 Cassandra CLI
通过NodeCmd:java org.apache.cassandra.tools.NodeCmd -p 7199 setcachecapacity Keyspace1 user 150000 150000