Adds table-open-cache charm config option, as per lp1402586.

Also increases the default for table_open_cache to 2048, as the default
of 512 is a bit too low (and there is no repercussions with using larger
table cache).

Note: table_cache got renamed to table_open_cache in MySQL 5.1.3, but 
mysql-common didn't address that. Change is made in the charm now so
that future upgrades (from 5.5 to 5.6) can be smooth.
This commit is contained in:
Mario Splivalo 2015-02-16 15:12:42 +01:00
parent 3ab816440f
commit 98741b3ad0
3 changed files with 7 additions and 3 deletions

View File

@ -68,6 +68,11 @@ options:
InnoDB table into separate .idb file. Existing InnoDB tables will remain
in ibdata1 file - full dump/import is needed to get rid of large
ibdata1 file
table-open-cache:
type: int
default: 2048
description:
Sets table_open_cache (formerly known as table_cache) to mysql.
lp1366997-workaround:
type: boolean
default: False

View File

@ -113,11 +113,10 @@ def render_config(clustered=False, hosts=[], mysql_password=None):
'sst_method': 'xtrabackup',
'sst_password': mysql_password,
'innodb_file_per_table': config('innodb-file-per-table'),
'table_open_cache': config('table-open-cache'),
'lp1366997_workaround': config('lp1366997-workaround')
}
print config
if config('prefer-ipv6'):
# NOTE(hopem): this is a kludge to get percona working with ipv6.
# See lp 1380747 for more info. This is intended as a stop gap until

View File

@ -61,7 +61,7 @@ max_connections = {{ max_connections }}
# Fine tuning
key_buffer_size = {{ key_buffer }}
table_cache = 512
table_open_cache = {{ table_open_cache }}
max_allowed_packet = 16M
# InnoDB buffer should consume 100% of the bytes of the dataset size