GithubHelp home page GithubHelp logo

isabella232 / pgbouncer-operator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canonical/pgbouncer-operator

0.0 0.0 0.0 82 KB

A charmed operator for running PgBouncer on machines.

License: Apache License 2.0

Python 100.00%

pgbouncer-operator's Introduction

PgBouncer Operator

Description

The PgBouncer Operator deploys and operates the PgBouncer lightweight connection pooler for PostgreSQL.

Usage

As this charm is not yet published, you need to follow the build and deploy instructions from CONTRIBUTING.md. This charm creates one pgbouncer application instance per CPU core on each machine it is deployed.

Config Options

Set these using the command juju config <option>=<value>.

  • pool_mode:

    • default: session
    • Specifies when a server connection can be reused by other clients.
    • Can be one of the following values:
      • session
        • Server is released back to pool after client disconnects.
      • transaction
        • Server is released back to pool after transaction finishes.
      • statement
        • Server is released back to pool after query finishes. Transactions spanning multiple statements are disallowed in this mode.
  • max_db_connections:

    • default: 0
    • Do not allow more than this many server connections per database (regardless of user). This considers the PgBouncer database that the client has connected to, not the PostgreSQL database of the outgoing connection.
    • Note that when you hit the limit, closing a client connection to one pool will not immediately allow a server connection to be established for another pool, because the server connection for the first pool is still open. Once the server connection closes (due to idle timeout), a new server connection will immediately be opened for the waiting pool.
    • 0 = unlimited

From these values and the current deployment, the following pgbouncer.ini config values are calculated:

  • effective_db_connections = max_db_connections / number of pgbouncer instances running on a machine
  • default_pool_size = effective_db_connections / 2
  • min_pool_size = effective_db_connections / 4
  • reserve_pool_size = effective_db_connections / 4

The following config values are set as constants in the charm:

  • max_client_conn = 10000
  • ignore_startup_parameters = extra_float_digits

Relations

Planned

  • db:[pgsql](https://github.com/canonical/ops-lib-pgsql/)
  • db-admin:[pgsql](https://github.com/canonical/ops-lib-pgsql/)
  • backend-db-admin:[pgsql](https://github.com/canonical/ops-lib-pgsql/)

The following relations provide support for the LMA charm bundle, our expected observability stack.

  • prometheus:prometheus_scrape
  • loki:loki_push_api
  • grafana:grafana_dashboards

License

The Charmed PgBouncer Operator is free software, distributed under the Apache Software License, version 2.0. See LICENSE for more information.

Security

Security issues in the Charmed PgBouncer Operator can be reported through LaunchPad. Please do not file GitHub issues about security issues.

Contributing

Please see the Juju SDK docs for guidelines on enhancements to this charm following best practice guidelines, and CONTRIBUTING.md for developer guidance.

pgbouncer-operator's People

Contributors

wrfitch 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.