GithubHelp home page GithubHelp logo

thawp99 / ansible-postgresql_tune Goto Github PK

View Code? Open in Web Editor NEW

This project forked from imincik/ansible-postgresql_tune

0.0 1.0 0.0 8 KB

Ansible postgresql_tune module

License: Other

Python 100.00%

ansible-postgresql_tune's Introduction

Ansible postgresql_tune module

Ansible module for automatic PostgreSQL tuning.

The module creates tuned settings for Postgres based on various use cases and system sizing parameters.

Tuned settings are written out to a specified config file, not to the main postgresql.conf.

Installation

Place postgresql_tune.py in your Ansible library directory

Requirements

Postgresql installation.

To include a separate config file with your postgresql.conf a common stanza is:-

include_dir = 'conf.d'

Duplicated parameters override parameters that occur earlier in the core postgresql.conf file.

Dependencies

None

Example Playbook

Postgresql 9.6

  vars:
    postgresql_version: 9.6
    postgresql_conf_directory: /etc/postgresql/9.6
    postgresql_tune_db_type: web
    postgresql_tune_total_memory: "{{ ansible_memtotal_mb }}MB"

  tasks:
  - name: Tune Postgresql
    postgresql_tune:
      db_version: "{{ postgresql_version }}"
      db_type: "{{ postgresql_tune_db_type }}"
      total_memory: "{{ postgresql_tune_total_memory }}"
      postgresql_file: "{{ postgresql_conf_directory }}/conf.d/99-postgresql-tune.conf"

Postgres 9.1 (with changes to kernel SHM settings and setting a max_connections)

  vars:
    postgresql_version: 9.6
    postgresql_conf_directory: /etc/postgresql/9.6
    postgresql_tune_db_type: web
    postgresql_tune_total_memory: "{{ ansible_memtotal_mb }}MB"
    postgresql_tune_sysctl_file: /etc/sysctl.d/99-postgresql-tune.conf
    postgresql_tune_connections: 50

  tasks:
  - name: Tune Postgresql
    postgresql_tune:
      db_version: "{{ postgresql_version }}"
      db_type: "{{ postgresql_tune_db_type }}"
      total_memory: "{{ postgresql_tune_total_memory }}"
      max_connections: "{{ postgresql_tune_connections }}"
      postgresql_file: "{{ postgresql_conf_directory }}/conf.d/99-postgresql-tune.conf"
      sysctl_file: "{{ postgresql_postgresql_tune_sysctl_file }}"

ansible-postgresql_tune's People

Contributors

imincik avatar josephramsay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.