On 28 Aug 2017, at 6:59 PM, Maciej Delmanowski
<drybjed(a)drybjed.net> wrote:
On Aug 28, hvjunk wrote:
> I’m currently looking at the PostgreSQL_server role, and are in need to
> tune/tweak the various parallel worker, WAL, shared memory configurations,
> and tune them differently for the environments, ie. Dev vs QA vs Prod vs
> Test.
>
> I’m especially looking for adding 9.6 (and I assume 10.x will also have)
> changed/only/new settings (Like parallel_workers). Also, in some cases
> I don’t want the normal % calculations for shared/cache memory, but rather
> a specific hard value.
>
> Before I’m going to re-invent yet another wheel, I was wondering about the
> advised ways of doing this that i might’ve missed in the
docs.debops.org
> site?
Hello,
I guess it currently might not be documented clearly enough. The
'debops.postgresql_server' role has the 'postgresql_server__clusters'
variable
which defines what clusters are present on a given server - there can be more
than one, for different PostgreSQL versions as well. The default cluster
that's set up by the role is defined in the
'postgresql_server__cluster_main'
variable.
The cluster configuration is defined as YAML dictionary, required
configuration parameters are 'name' and 'port', the rest is inferred
automatically. You can specify any values defined in the 'postgresql.conf'
configuration file, as well as some additional ones described in the role
documentation.
For your example, you could redefine the default PostgreSQL cluster like this:
postgresql_server__cluster_main:
name: 'main'
port: '5432'
shared_buffers: '32M'
max_connections: '100'
It looks like 'parallel_workers' and other configuration introduced in
PostgreSQL 9.6 is not yet accounted for in the configuration template, so you
could add that and post a PR for the role. You can use version_compare()
filter in the template to restrict these variables to specific PostgreSQL
versions, examples are in the templates.
Thank you for the pointer, will rTFM the source code ;)
What I did see thus far that I’ll include in a PR: the include_dir/include_if_exist as
options to that {{item}} variable, easy method to then add elsewhere my extra configs
(like I forgot: auto_explain)
Cheers,
Maciej
_______________________________________________
debops-users mailing list
debops-users(a)lists.debops.org
https://lists.debops.org/mailman/listinfo/debops-users