This commit is contained in:
Jorge Niedbalski 2015-06-04 11:40:54 -03:00
parent b9a213f344
commit b5b8049c3b
3 changed files with 21 additions and 11 deletions

View File

@ -10,7 +10,7 @@ options:
Key ID to import to the apt keyring to support use with arbitary source
configuration from outside of Launchpad archives or PPA's.
dataset-size:
default: '80%'
default:
type: string
description: How much data do you want to keep in memory in the DB. This will be used to tune settings in the database server appropriately. Suffix this value with 'K','M','G', or 'T' to get the relevant kilo/mega/etc. bytes. If suffixed with %, one will get that percentage of RAM devoted to dataset.
max-connections:
@ -103,3 +103,11 @@ options:
description: |
A comma-separated list of nagios servicegroups.
If left empty, the nagios_context will be used as the servicegroup
innodb-buffer-pool-size:
default:
type: string
description: |
By default this value will be set according to the 50% of system total memory
but also can be set to any specific value for the system.
Suffix this value with 'K','M','G', or 'T' to get the relevant kilo/mega/etc. bytes.
If suffixed with %, one will get that percentage of system total memory devoted.

View File

@ -385,23 +385,25 @@ class PerconaClusterHelper(object):
mysql_config['key_buffer'] = self.human_to_bytes('32M')
total_memory = self.human_to_bytes(self.get_mem_total())
log("Option 'dataset-size' has been deprecated, instead by default %d%% of system \
available RAM will be used for innodb_buffer_pool_size allocation" %
(self.DEFAULT_INNODB_BUFFER_FACTOR * 100), level="WARN")
dataset_bytes = config.get('dataset-size', None)
innodb_buffer_pool_size = config.get('innodb-buffer-pool-size', None)
if innodb_buffer_pool_size:
innodb_buffer_pool_size = self.human_to_bytes(
innodb_buffer_pool_size)
if innodb_buffer_pool_size > total_memory:
log("innodb_buffer_pool_size; {} is greater than system available memory:{}".format(
innodb_buffer_pool_size,
total_memory), level='WARN')
elif dataset_bytes:
log("Option 'dataset-size' has been deprecated, please use"
"innodb_buffer_pool_size option instead", level="WARN")
innodb_buffer_pool_size = self.human_to_bytes(
dataset_bytes)
else:
innodb_buffer_pool_size = int(
total_memory * self.DEFAULT_INNODB_BUFFER_FACTOR)
if innodb_buffer_pool_size > total_memory:
log("innodb_buffer_pool_size; {} is greater than system available memory:{}".format(
innodb_buffer_pool_size,
total_memory), level='WARN')
mysql_config['innodb_buffer_pool_size'] = innodb_buffer_pool_size
return mysql_config

View File

@ -72,7 +72,7 @@ max_allowed_packet = 16M
# InnoDB buffer should consume 100% of the bytes of the dataset size
# query cache is not supported with Active/Active configuration
innodb_buffer_pool_size = {{ dataset_bytes }}
innodb_buffer_pool_size = {{ innodb_buffer_pool_size }}
{% if ipv6 -%}
[sst]