[jjo, r=niedbalski] Fixes bug lp: #1386791.
- sync charmhelpers, then expose wait-timeout config
This commit is contained in:
commit
99bb8eaabe
@ -11,6 +11,10 @@ options:
|
||||
default: -1
|
||||
type: int
|
||||
description: Maximum connections to allow. -1 means use the server's compiled in default.
|
||||
wait-timeout:
|
||||
default: -1
|
||||
type: int
|
||||
description: The number of seconds the server waits for activity on a noninteractive connection before closing it. -1 means use the server's compiled in default.
|
||||
root-password:
|
||||
type: string
|
||||
default:
|
||||
|
@ -1,6 +1,5 @@
|
||||
"""Helper for working with a MySQL database"""
|
||||
import json
|
||||
import socket
|
||||
import re
|
||||
import sys
|
||||
import platform
|
||||
@ -22,7 +21,6 @@ from charmhelpers.core.hookenv import (
|
||||
log,
|
||||
DEBUG,
|
||||
INFO,
|
||||
WARNING,
|
||||
)
|
||||
from charmhelpers.fetch import (
|
||||
apt_install,
|
||||
@ -359,6 +357,9 @@ class PerconaClusterHelper(object):
|
||||
if 'max-connections' in config:
|
||||
mysql_config['max_connections'] = config['max-connections']
|
||||
|
||||
if 'wait-timeout' in config:
|
||||
mysql_config['wait_timeout'] = config['wait-timeout']
|
||||
|
||||
# Set a sane default key_buffer size
|
||||
mysql_config['key_buffer'] = self.human_to_bytes('32M')
|
||||
total_memory = self.human_to_bytes(self.get_mem_total())
|
||||
|
@ -59,6 +59,11 @@ wsrep_sst_auth="sstuser:{{ sst_password }}"
|
||||
max_connections = {{ max_connections }}
|
||||
{% endif %}
|
||||
|
||||
# Seconds before clearing idle connections
|
||||
{% if wait_timeout != -1 %}
|
||||
wait_timeout = {{ wait_timeout }}
|
||||
{% endif %}
|
||||
|
||||
# Fine tuning
|
||||
key_buffer_size = {{ key_buffer }}
|
||||
table_open_cache = {{ table_open_cache }}
|
||||
|
Loading…
Reference in New Issue
Block a user