{"id":20632483,"url":"https://github.com/citusdata/pg_octopus","last_synced_at":"2025-06-16T11:33:33.898Z","repository":{"id":149339994,"uuid":"50834933","full_name":"citusdata/pg_octopus","owner":"citusdata","description":"A health checker for PostgreSQL","archived":false,"fork":false,"pushed_at":"2016-04-02T15:11:25.000Z","size":15,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-15T18:59:52.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/citusdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-02-01T11:24:01.000Z","updated_at":"2024-11-28T16:32:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0ffe3c9-4a2c-42ef-ab0c-71360cf64633","html_url":"https://github.com/citusdata/pg_octopus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/citusdata/pg_octopus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citusdata%2Fpg_octopus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citusdata%2Fpg_octopus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citusdata%2Fpg_octopus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citusdata%2Fpg_octopus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/citusdata","download_url":"https://codeload.github.com/citusdata/pg_octopus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/citusdata%2Fpg_octopus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260150806,"owners_count":22966385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T14:16:20.270Z","updated_at":"2025-06-16T11:33:33.888Z","avatar_url":"https://github.com/citusdata.png","language":"C","readme":"# pg_octopus\n\npg_octopus is an extension for PostgreSQL that health checks a cluster of PostgreSQL nodes in the background.\n\n## Installation\n\nThe easiest way to install pg_octopus is to build the sources from GitHub.\n\n    git clone https://github.com/citusdata/pg_octopus.git\n    cd pg_octopus\n    PATH=/usr/local/pgsql/bin/:$PATH make\n    sudo PATH=/usr/local/pgsql/bin/:$PATH make install\n\nAfter installing the extension, run the following in psql:\n\n    CREATE EXTENSION pg_octopus;\n    \npg_octopus uses a background worker to perform health checks. To activate the background worker, add pg_octopus to the shared_preload_libraries in postgresql.conf and restart postgres.\n\n    # in postgresql.conf\n    shared_preload_libraries = 'pg_octopus'\n\n## Usage\n\nTo create a health check for a server, simple add its address to the octopus.nodes table.\n\n     postgres=# INSERT INTO octopus.nodes VALUES ('10.192.0.247', 5432);\n     INSERT 0 1\n     postgres=# SELECT * FROM octopus.nodes;\n       node_name   | node_port | health_status \n     --------------+-----------+---------------\n      10.192.0.246 |      5432 |             0\n      10.192.0.247 |      5432 |             1\n     (2 rows)\n\nIn the health_status column, 1 means health, 0 means unhealthy, -1 means unknown.\n\n## Health checks\n\npg_octopus performs health-checks in rounds of 'health_check_period' by trying to connect to nodes using libpq. If it fails to connect within 'health_check_timeout', it tries again after 'health_check_retry_delay' for at most 'health_check_max_retries' times. The default configuration values are shown below.\n\n    pg_octopus.health_check_period = 10000 # round duration (in ms)\n    pg_octopus.health_check_timeout = 2000 # connection timeout (in ms)\n    pg_octopus.health_check_max_retries = 2 # maximum number of re-tries\n    pg_octopus.health_check_retry_delay = 1000 # time between consecutive re-tries (in ms)\n    \nNote that health_check_timeout + health_check_max_retries * (health_check_retry_delay + health_check_timeout) should be smaller than health_check_period.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitusdata%2Fpg_octopus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcitusdata%2Fpg_octopus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcitusdata%2Fpg_octopus/lists"}