我試圖建立對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 doc,我不認爲它有一種方法來捕捉 cat /proc/cpuinfo | grep processor | wc -l
我在想是這樣的輸出:
食譜 - 卡桑德拉/食譜/ 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
食譜-卡桑德拉/屬性/ default.rb
default[:cassandra] = {
...
# determined by 8 * number of cores
:concurrent_reads => 16,
:concurrent_writes => 16,
..
}