Я пытаюсь установить новую поваренную книгу для Кассандры, и на cassandra.yaml
файл, который имеет следование комментариев по поводу оптимальных параметров:Используя рецепты Cookbook шефа динамически переопределить атрибут
# 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,
..
}