Skip to content

Commit

Permalink
Merge pull request #19 from SUSE/mc-update-autotuning
Browse files Browse the repository at this point in the history
update autotuning
  • Loading branch information
mantel authored Aug 21, 2017
2 parents 5df748d + f699a49 commit 4698169
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup (
name = 'SUSE Manager Database Control',
version = '1.5.9',
version = '1.6.0',
package_dir = {'': 'src'},
package_data={'smdba': ['scenarios/*.scn']},
packages = [
Expand Down
17 changes: 12 additions & 5 deletions src/smdba/postgresqlgate.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,8 @@ def do_system_check(self, *args, **params):
"""
Common backend healthcheck.
@help
autotuning\tperform initial autotuning of the database
autotuning\t\tperform initial autotuning of the database
--max_connections=<num>\tdefine maximal number of database connections (default: 400)
"""
# Check enough space

Expand All @@ -910,8 +911,9 @@ def do_system_check(self, *args, **params):
#

# Built-in tuner
conn_lowest = 400
max_conn = int(params.get('max_connections', conn_lowest))
conn_lowest = 270
conn_default = 400
max_conn = int(params.get('max_connections', conn_default))
if max_conn < conn_lowest:
print >> sys.stdout, 'INFO: max_connections should be at least {0}'.format(conn_lowest)
max_conn = conn_lowest
Expand All @@ -928,7 +930,7 @@ def do_system_check(self, *args, **params):
changed = True

# WAL senders at least 5
if not conf.get('max_wal_senders') or conf.get('max_wal_senders') < '5':
if not conf.get('max_wal_senders') or int(conf.get('max_wal_senders')) < 5:
conf['max_wal_senders'] = 5
changed = True

Expand All @@ -948,7 +950,7 @@ def do_system_check(self, *args, **params):
changed = True

# max_locks_per_transaction
if not conf.get('max_locks_per_transaction') or conf.get('max_locks_per_transaction') < '100':
if not conf.get('max_locks_per_transaction') or int(conf.get('max_locks_per_transaction')) < 100:
conf['max_locks_per_transaction'] = 100
changed = True

Expand All @@ -962,6 +964,11 @@ def do_system_check(self, *args, **params):
conf['bytea_output'] = "'escape'"
changed = True

# bsc#1022286 - too low value for statistic_target
if int(conf.get('default_statistics_target', 100)) <= 10:
del conf['default_statistics_target']
changed = True

#
# Setup pg_hba.conf
# Format is pretty specific :-)
Expand Down
2 changes: 1 addition & 1 deletion src/smdba/smdba
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Console:
"""

# General
VERSION = "1.5.9"
VERSION = "1.6.0"
DEFAULT_CONFIG = "/etc/rhn/rhn.conf"

# Config
Expand Down

0 comments on commit 4698169

Please sign in to comment.