Cassandra-2.1.8中的轻量级事务(比较和设置)需要考虑哪些设置?
一个。我们在表上使用令牌感知负载平衡策略和LeveledCompactionStrategy设置。表具有在主键中具有单个列的瘦行。我们为所有查询使用预准备语句,并准备一次并缓存。
湾以下是设置,
一世。 Max Heap - 4G,新堆 - 1G,4核CPU,CentOS
II。连接池基于测试的并发设置。
final PoolingOptions pools = new PoolingOptions(); pools.setNewConnectionThreshold(HostDistance.LOCAL, concurrency); pools.setCoreConnectionsPerHost(HostDistance.LOCAL, maxConnections); pools.setMaxConnectionsPerHost(HostDistance.LOCAL, maxConnections); pools.setCoreConnectionsPerHost(HostDistance.REMOTE, maxConnections); pools.setMaxConnectionsPerHost(HostDistance.REMOTE, maxConnections);
III。协议版本 - V3
IV。将tcp delay设置为true可禁用Nagle的算法。 (默认)
v。启用压缩。
2.吞吐量随着单个连接的并发性而增加。对于CAS RW,吞吐量确实与Simple RW相同。
100000 requests, 1 thread Simple RW CAS RW
Mean rate (ops/sec) 643 265.4
Mean latency (ms) 1.554 3.765
Median latency (ms) 1.332 2.996
75th percentile latency (ms) 1.515 3.809
95th percentile latency (ms) 2.458 8.121
99th percentile latency (ms) 5.038 11.52
Standard latency deviation 0.992 2.139
100000 requests, 25 threads Simple RW CAS RW
Mean rate (ops/sec) 7686 1881
Mean latency (ms) 3.25 13.29
Median latency (ms) 2.695 12.203
75th percentile latency (ms) 3.669 14.389
95th percentile latency (ms) 6.378 20.139
99th percentile latency (ms) 11.59 61.973
Standard latency deviation 3.065 6.492
答案 0 :(得分:0)
LWT速度最重要的考虑因素是分区争用。如果您在单个分区上有多个更新,则速度会更慢。除此之外,您正在考虑机器性能调整。
这里有一个免费的完整课程可以帮助您:https://academy.datastax.com/courses/ds210-operations-and-performance-tuning