The tuning role configures the system and Postgres instances for optimal performances. Most of the configuration values are calculated automatically from available resources found on the system.
Following are the dependencies and requirement of this role.
- Ansible
When executing the role via ansible these are the required variables:
- pg_version
Postgres Versions supported are: 10, 11, 12, 13 and 14
- pg_type
Database Engine supported are: PG and EPAS
These and other variables can be assigned in the pre_tasks
definition of the
section: How to include the tuning
role in your Playbook
The rest of the variables can be configured and are available in the:
This is the tuned
profile name used for configuring the system. Default: edb
Example:
tuned_profile: "edb"
tuned
configuration directory path. Default: /etc/tuned
Example:
tuned_configuration_dir: "/etc/tuned"
Let the role knows if the system uses SSD disk based storage. Default: no
Example:
ssd_disk: yes
This role does not have any dependencies, but a Postgres instance should have
been deployed beforehand with the init_dbserver
or setup_replication
roles.
Content of the inventory.yml
file:
---
all:
children:
primary:
hosts:
primary1:
ansible_host: xxx.xxx.xxx.xxx
private_ip: xxx.xxx.xxx.xxx
standby:
hosts:
standby1:
ansible_host: xxx.xxx.xxx.xxx
private_ip: xxx.xxx.xxx.xxx
upstream_node_private_ip: xxx.xxx.xxx.xxx
Below is an example of how to include the tuning
role:
---
- hosts: pemserver,primary,standby
name: Apply system and Postgres recommanded performance tuning
become: true
gather_facts: yes
collections:
- edb_devops.edb_postgres
pre_tasks:
- name: Initialize the user defined variables
set_fact:
pg_type: "PG"
pg_version: 14
ssd_disk: yes
roles:
- role: tuning
Defining and adding variables is done in the set_fact
of the pre_tasks
.
All the variables are available at:
BSD
Author:
- Julien Tachoires
- Vibhor Kumar (Reviewer)
- EDB Postgres
- [email protected] www.enterprisedb.com