Skip to content

Commit b7241cc

Browse files
committed
Use pgbouncer
1 parent 57f8acc commit b7241cc

File tree

5 files changed

+15
-34
lines changed

5 files changed

+15
-34
lines changed

docker-compose.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ x-sentry-defaults: &sentry_defaults
3636
<<: *depends_on-healthy
3737
kafka:
3838
<<: *depends_on-healthy
39-
pgcat:
39+
pgbouncer:
4040
<<: *depends_on-healthy
4141
memcached:
4242
<<: *depends_on-default
@@ -146,20 +146,24 @@ services:
146146
POSTGRES_PASSWORD: "sentry"
147147
volumes:
148148
- "sentry-postgres:/var/lib/postgresql/data"
149-
pgcat:
150-
image: "ghcr.io/postgresml/pgcat:v1.2.0"
149+
pgbouncer:
150+
image: "edoburu/pgbouncer:v1.24.1-p1"
151151
healthcheck:
152152
<<: *healthcheck_defaults
153153
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
154154
test: ["CMD-SHELL", "PGPASSWORD=\"sentry\" psql -U postgres -p 5432 -h 127.0.0.1 -tA -c \"select 1;\" -d postgres >/dev/null"]
155155
depends_on:
156156
postgres:
157157
<<: *depends_on-healthy
158-
volumes:
159-
- type: bind
160-
read_only: true
161-
source: ./pgcat.toml
162-
target: /etc/pgcat/pgcat.toml
158+
environment:
159+
DB_USER: ${POSTGRES_USER:-postgres}
160+
DB_PASSWORD: sentry
161+
DB_HOST: postgres
162+
DB_NAME: postgres
163+
POOL_MODE: transaction
164+
ADMIN_USERS: postgres,sentry
165+
MAX_CLIENT_CONN: 10000
166+
163167
kafka:
164168
<<: *restart_policy
165169
image: "confluentinc/cp-kafka:7.6.1"

install/set-up-and-migrate-database.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ echo "${_group}Setting up / migrating database ..."
33
if [[ -z "${SKIP_SENTRY_MIGRATIONS:-}" ]]; then
44
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
55
start_service_and_wait_ready postgres
6-
start_service_and_wait_ready pgcat
6+
start_service_and_wait_ready pgbouncer
77

88
os=$($dc exec postgres cat /etc/os-release | grep 'ID=debian')
99
if [[ -z $os ]]; then

pgcat.toml

Lines changed: 0 additions & 23 deletions
This file was deleted.

sentry-admin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on the host filesystem. Commands that write files should write them to the '/sen
2424
# Actual invocation that runs the command in the container.
2525
invocation() {
2626
start_service_and_wait_ready postgres
27-
start_service_and_wait_ready pgcat
27+
start_service_and_wait_ready pgbouncer
2828
start_service_and_wait_ready redis --wait
2929
$dcr --no-deps -v "$VOLUME_MAPPING" -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1
3030
}

sentry/sentry.conf.example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_internal_network():
4848
"NAME": "postgres",
4949
"USER": "postgres",
5050
"PASSWORD": "sentry",
51-
"HOST": "pgcat",
51+
"HOST": "pgbouncer",
5252
"PORT": "",
5353
}
5454
}

0 commit comments

Comments
 (0)