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
This commit is contained in:
Sushil Kumar 2015-04-04 16:05:05 +00:00
parent 4262477557
commit 49f55f0edb
4 changed files with 26 additions and 27 deletions

View File

@ -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

View File

@ -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 @@
}
}
}

View File

@ -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}}

View File

@ -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}}