diff options
author | Sushil Kumar <sushil.kumar3@hp.com> | 2015-04-04 16:05:05 +0000 |
---|---|---|
committer | Sushil Kumar <sushil.kumar3@hp.com> | 2015-04-06 14:42:27 +0000 |
commit | 49f55f0edb3c1a479624c7bc4069a3b1ed55222b (patch) | |
tree | 3dcb3a926139490858e5073e9db51d699625511c | |
parent | 4262477557bf327ef5bb049ca590901a3a9137f8 (diff) | |
download | trove-49f55f0edb3c1a479624c7bc4069a3b1ed55222b.tar.gz |
Fixes config templates for mysql & percona
Calculations for certain config parameters was resulting in zero
if a value < 512 was used as ram for flavors to boot guest instance.
Replaced '//' by '/' and the result is again casted to integer value
as needed by mysql configurations.
// implies divide two numbers and return
the truncated integer result.
whereas
/ implies divide two numbers and return value
will be a floating point number.
Updated default instance configuration response json.
Change-Id: Icfc84a4cb380264670aa4e31f372eb39a6e87c7c
Closes-Bug: #1440358
4 files changed, 26 insertions, 27 deletions
diff --git a/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt b/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt index 375b0be1..b59d8be5 100644 --- a/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt +++ b/apidocs/src/samples/db-get-default-instance-configuration-response-json.txt @@ -1,5 +1,5 @@ HTTP/1.1 200 OK Content-Type: application/json -Content-Length: 1074 +Content-Length: 1077 Date: Mon, 18 Mar 2013 19:09:17 GMT diff --git a/apidocs/src/samples/db-get-default-instance-configuration-response.json b/apidocs/src/samples/db-get-default-instance-configuration-response.json index 9125831e..c200ff84 100644 --- a/apidocs/src/samples/db-get-default-instance-configuration-response.json +++ b/apidocs/src/samples/db-get-default-instance-configuration-response.json @@ -14,7 +14,7 @@ "join_buffer_size": "1M", "key_buffer_size": "50M", "local-infile": "0", - "max_allowed_packet": "1M", + "max_allowed_packet": "1024K", "max_connections": "100", "max_heap_table_size": "16M", "max_user_connections": "100", @@ -41,4 +41,3 @@ } } } - diff --git a/trove/templates/mysql/config.template b/trove/templates/mysql/config.template index 21d56ea2..912d381f 100644 --- a/trove/templates/mysql/config.template +++ b/trove/templates/mysql/config.template @@ -13,16 +13,16 @@ datadir = /var/lib/mysql tmpdir = /var/tmp pid_file = /var/run/mysqld/mysqld.pid skip-external-locking = 1 -key_buffer_size = {{ 50 * flavor['ram']//512 }}M -max_allowed_packet = {{ 1 * flavor['ram']//512 }}M +key_buffer_size = {{ (50 * flavor['ram']/512)|int }}M +max_allowed_packet = {{ (1024 * flavor['ram']/512)|int }}K thread_stack = 192K -thread_cache_size = {{ 4 * flavor['ram']//512 }} +thread_cache_size = {{ (4 * flavor['ram']/512)|int }} myisam-recover = BACKUP query_cache_type = 1 query_cache_limit = 1M -query_cache_size = {{ 8 * flavor['ram']//512 }}M +query_cache_size = {{ (8 * flavor['ram']/512)|int }}M innodb_data_file_path = ibdata1:10M:autoextend -innodb_buffer_pool_size = {{ 150 * flavor['ram']//512 }}M +innodb_buffer_pool_size = {{ (150 * flavor['ram']/512)|int }}M innodb_file_per_table = 1 innodb_log_files_in_group = 2 innodb_log_file_size=50M @@ -33,13 +33,13 @@ join_buffer_size = 1M read_buffer_size = 512K read_rnd_buffer_size = 512K sort_buffer_size = 1M -tmp_table_size = {{ 16 * flavor['ram']//512 }}M -max_heap_table_size = {{ 16 * flavor['ram']//512 }}M -table_open_cache = {{ 256 * flavor['ram']//512 }} -table_definition_cache = {{ 256 * flavor['ram']//512 }} -open_files_limit = {{ 512 * flavor['ram']//512 }} -max_user_connections = {{ 100 * flavor['ram']//512 }} -max_connections = {{ 100 * flavor['ram']//512 }} +tmp_table_size = {{ (16 * flavor['ram']/512)|int }}M +max_heap_table_size = {{ (16 * flavor['ram']/512)|int }}M +table_open_cache = {{ (256 * flavor['ram']/512)|int }} +table_definition_cache = {{ (256 * flavor['ram']/512)|int }} +open_files_limit = {{ (512 * flavor['ram']/512)|int }} +max_user_connections = {{ (100 * flavor['ram']/512)|int }} +max_connections = {{ (100 * flavor['ram']/512)|int }} default_storage_engine = innodb local-infile = 0 server_id = {{server_id}} diff --git a/trove/templates/percona/config.template b/trove/templates/percona/config.template index 21d56ea2..912d381f 100644 --- a/trove/templates/percona/config.template +++ b/trove/templates/percona/config.template @@ -13,16 +13,16 @@ datadir = /var/lib/mysql tmpdir = /var/tmp pid_file = /var/run/mysqld/mysqld.pid skip-external-locking = 1 -key_buffer_size = {{ 50 * flavor['ram']//512 }}M -max_allowed_packet = {{ 1 * flavor['ram']//512 }}M +key_buffer_size = {{ (50 * flavor['ram']/512)|int }}M +max_allowed_packet = {{ (1024 * flavor['ram']/512)|int }}K thread_stack = 192K -thread_cache_size = {{ 4 * flavor['ram']//512 }} +thread_cache_size = {{ (4 * flavor['ram']/512)|int }} myisam-recover = BACKUP query_cache_type = 1 query_cache_limit = 1M -query_cache_size = {{ 8 * flavor['ram']//512 }}M +query_cache_size = {{ (8 * flavor['ram']/512)|int }}M innodb_data_file_path = ibdata1:10M:autoextend -innodb_buffer_pool_size = {{ 150 * flavor['ram']//512 }}M +innodb_buffer_pool_size = {{ (150 * flavor['ram']/512)|int }}M innodb_file_per_table = 1 innodb_log_files_in_group = 2 innodb_log_file_size=50M @@ -33,13 +33,13 @@ join_buffer_size = 1M read_buffer_size = 512K read_rnd_buffer_size = 512K sort_buffer_size = 1M -tmp_table_size = {{ 16 * flavor['ram']//512 }}M -max_heap_table_size = {{ 16 * flavor['ram']//512 }}M -table_open_cache = {{ 256 * flavor['ram']//512 }} -table_definition_cache = {{ 256 * flavor['ram']//512 }} -open_files_limit = {{ 512 * flavor['ram']//512 }} -max_user_connections = {{ 100 * flavor['ram']//512 }} -max_connections = {{ 100 * flavor['ram']//512 }} +tmp_table_size = {{ (16 * flavor['ram']/512)|int }}M +max_heap_table_size = {{ (16 * flavor['ram']/512)|int }}M +table_open_cache = {{ (256 * flavor['ram']/512)|int }} +table_definition_cache = {{ (256 * flavor['ram']/512)|int }} +open_files_limit = {{ (512 * flavor['ram']/512)|int }} +max_user_connections = {{ (100 * flavor['ram']/512)|int }} +max_connections = {{ (100 * flavor['ram']/512)|int }} default_storage_engine = innodb local-infile = 0 server_id = {{server_id}} |