问题描述
我正在使用cassandra作为后端的spring / java网络应用程序上工作;该应用程序可能同时被数百名客户使用。
我看到默认的Cluster PoolingOptions连接池设置(使用协议v3)是:
本地主机:core = max = 1
远程主机:core = max = 1
,默认的maxRequestsPerConnection设置(使用协议v3)为:
对于本地主机为1024,对于远程主机为256。
这些默认设置是否足以满足我们的使用要求?
如果没有,我可以从哪些池选项开始?
我建议使用默认的 PoolingOptions
。除非您有充分的理由,否则不应该真正接触它。
请注意,该配置是针对每个主机的 ,而不是针对整个集群。 / p>
此外,默认情况下,cassandra一次仅处理128个本机传输请求(),因此配置 PoolingOptions
处理每个低1024个请求
最后,在基准测试和具有少量节点的高吞吐量场景中,将每台主机的连接数增加到8个可以表明吞吐量有所提高,但是随着您添加更多的C *主机,改进变得微不足道。
I'm Working on a spring/java webapp using cassandra as backend; the app would be used by potentially hundreds of customers simultaneously.
I see that default Cluster PoolingOptions connection pool settings (With protocol v3) are:
LOCAL hosts: core = max = 1
REMOTE hosts: core = max = 1
And default maxRequestsPerConnection setting (With protocol v3) is:
1024 for LOCAL hosts, and 256 for REMOTE hosts.
Will these default settings be sufficient to fulfill our usage requirements?
If not, What poolingoptions can I start with?
I would recommend using the default PoolingOptions
. It should not really be touched unless you have a good reason.
Note that the configuration is per host, not for the entire cluster.
Also, by default cassandra only processes 128 native transport requests at a time (native_transport_max_threads), so configuring PoolingOptions
to handle more than 1024 requests per connection has low utility.
Finally, during benchmarking and high throughput scenarios with a small number of nodes, increasing the number of connections per host to something like 8 can show some improvement in throughput, but as you add more C* hosts that improvement becomes marginal.
这篇关于Cassandra Datastax最佳合并选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!