我正在尝试为 Cassandra 设置一个新的食谱,并在cassandra.yaml
文件中包含以下关于最佳设置的评论:
# For workloads with more data than can fit in memory, Cassandra's
# bottleneck will be reads that need to fetch data from
# disk. "concurrent_reads" should be set to (16 * number_of_drives) in
# order to allow the operations to enqueue low enough in the stack
# that the OS and drives can reorder them.
#
# On the other hand, since writes are almost never IO bound, the ideal
# number of "concurrent_writes" is dependent on the number of cores in
# your system; (8 * number_of_cores) is a good rule of thumb.
但是,无法确定属性中的numbers of cores
或numbers of disk drives
预定义的,因为部署的服务器可能具有不同的硬件设置。
是否可以使用已部署的硬件设置动态覆盖属性?我阅读了Opscode 文档,但我认为它没有办法从
cat /proc/cpuinfo | grep processor | wc -l
我在想这样的事情:
食谱-cassandra/recipes/default.rb
cores = command "cat /proc/cpuinfo | grep processor | wc -l"
node.default["cassandra"]["concurrent_reads"] = cores*8
node.default["cassandra"]["concurrent_writes"] = cores*8
食谱-cassandra/属性/default.rb
default[:cassandra] = {
...
# determined by 8 * number of cores
:concurrent_reads => 16,
:concurrent_writes => 16,
..
}