From 7c2dcc960cd67656ed25398e342cc59204a7f997 Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Sun, 20 Aug 2017 18:48:59 +0200 Subject: [PATCH 1/5] differ between minimal required connections and our default connections The minimal required connections are calculated with 270 for the current default setting of apach, tomcat, etc in SUSE. We just define a higher default of 400 but we should give a customer the opportunity to choose a lower value and have more memory per connection. --- src/smdba/postgresqlgate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/smdba/postgresqlgate.py b/src/smdba/postgresqlgate.py index 0d451b9..71755d6 100644 --- a/src/smdba/postgresqlgate.py +++ b/src/smdba/postgresqlgate.py @@ -910,8 +910,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 From 93c258dcd16edb0a9a2e76802926b25612cb5f51 Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Sun, 20 Aug 2017 19:01:14 +0200 Subject: [PATCH 2/5] use default value for default_statistics_target if configured value is too small (bsc#1022286) --- src/smdba/postgresqlgate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/smdba/postgresqlgate.py b/src/smdba/postgresqlgate.py index 71755d6..a610249 100644 --- a/src/smdba/postgresqlgate.py +++ b/src/smdba/postgresqlgate.py @@ -963,6 +963,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 :-) From 7cd9a4398e81216d8b3faa7adf8f8612c63bf872 Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Sun, 20 Aug 2017 19:06:10 +0200 Subject: [PATCH 3/5] use integer values when doing a greater than / lower than comparison --- src/smdba/postgresqlgate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/smdba/postgresqlgate.py b/src/smdba/postgresqlgate.py index a610249..9f18a45 100644 --- a/src/smdba/postgresqlgate.py +++ b/src/smdba/postgresqlgate.py @@ -929,7 +929,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 @@ -949,7 +949,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 From a31dfb0d9778484c436430fc09ea88a711688693 Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Sun, 20 Aug 2017 19:19:30 +0200 Subject: [PATCH 4/5] add help for defining max_connections --- src/smdba/postgresqlgate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smdba/postgresqlgate.py b/src/smdba/postgresqlgate.py index 9f18a45..c03704d 100644 --- a/src/smdba/postgresqlgate.py +++ b/src/smdba/postgresqlgate.py @@ -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=\tdefine maximal number of database connections (default: 400) """ # Check enough space From f699a49dadda347a8d2159fedf9e46544bbdbcdb Mon Sep 17 00:00:00 2001 From: Hubert Mantel Date: Mon, 21 Aug 2017 13:28:08 +0200 Subject: [PATCH 5/5] bump version number to 1.6.0 --- setup.py | 2 +- src/smdba/smdba | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b3c3311..a3dd880 100644 --- a/setup.py +++ b/setup.py @@ -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 = [ diff --git a/src/smdba/smdba b/src/smdba/smdba index 643cf41..fc4b2ca 100755 --- a/src/smdba/smdba +++ b/src/smdba/smdba @@ -39,7 +39,7 @@ class Console: """ # General - VERSION = "1.5.9" + VERSION = "1.6.0" DEFAULT_CONFIG = "/etc/rhn/rhn.conf" # Config