From a909447a0f42afe2f527483ecc47db2841cc1381 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Sun, 28 Jan 2024 19:41:01 +0330 Subject: [PATCH 1/7] increase postgres max_connections above 100 connections --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 76aa45f2497..c1d9a961861 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -144,6 +144,8 @@ services: "max_replication_slots=1", "-c", "max_wal_senders=1", + "-c", + "max_connections=300", ] environment: POSTGRES_HOST_AUTH_METHOD: "trust" From 3ed1e9f8c9e4a3b62332f2b2d626628e2203a007 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:26:23 +0330 Subject: [PATCH 2/7] use default value and env for postgres max_connections --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c1d9a961861..85a21866e70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -145,7 +145,7 @@ services: "-c", "max_wal_senders=1", "-c", - "max_connections=300", + "max_connections=${POSTGRES_MAX_CONNECTIONS:-300}", ] environment: POSTGRES_HOST_AUTH_METHOD: "trust" From 8dc6853b98c4fcfa5d0bf4898cb569b2423e2552 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:21:32 +0330 Subject: [PATCH 3/7] change back the default postgres max_connections to 100 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 85a21866e70..f94040955ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -145,7 +145,7 @@ services: "-c", "max_wal_senders=1", "-c", - "max_connections=${POSTGRES_MAX_CONNECTIONS:-300}", + "max_connections=${POSTGRES_MAX_CONNECTIONS:-100}", ] environment: POSTGRES_HOST_AUTH_METHOD: "trust" From 7b0b63de9d9f6b79820021a88a25a96e05f1bf54 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Thu, 1 Feb 2024 04:57:19 +0330 Subject: [PATCH 4/7] added postgres max_connections in .env file --- .env | 1 + 1 file changed, 1 insertion(+) diff --git a/.env b/.env index 55fa4333520..de9210e4a25 100644 --- a/.env +++ b/.env @@ -14,3 +14,4 @@ WAL2JSON_VERSION=latest HEALTHCHECK_INTERVAL=30s HEALTHCHECK_TIMEOUT=1m30s HEALTHCHECK_RETRIES=10 +POSTGRES_MAX_CONNECTIONS=100 From 420488bf27939e71d8e23b9537c5c900f9846554 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Fri, 1 Mar 2024 00:01:42 +0330 Subject: [PATCH 5/7] added warning about raising POSTGRES_MAX_CONNECTIONS --- .env | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.env b/.env index de9210e4a25..e30facc7f4b 100644 --- a/.env +++ b/.env @@ -14,4 +14,6 @@ WAL2JSON_VERSION=latest HEALTHCHECK_INTERVAL=30s HEALTHCHECK_TIMEOUT=1m30s HEALTHCHECK_RETRIES=10 +# Caution: Raising max connection of postgres uses additional CPU and RAM +# see https://github.com/getsentry/self-hosted/pull/2740 for more POSTGRES_MAX_CONNECTIONS=100 From 6a3c0c81ab85a0c4cffa613498a3ed6ed2d99ef6 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:11:25 +0330 Subject: [PATCH 6/7] fix typo Co-authored-by: Amin Vakil --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index e30facc7f4b..7dbbd9ffcfb 100644 --- a/.env +++ b/.env @@ -14,6 +14,6 @@ WAL2JSON_VERSION=latest HEALTHCHECK_INTERVAL=30s HEALTHCHECK_TIMEOUT=1m30s HEALTHCHECK_RETRIES=10 -# Caution: Raising max connection of postgres uses additional CPU and RAM +# Caution: Raising max connections of postgres increases CPU and RAM usage # see https://github.com/getsentry/self-hosted/pull/2740 for more POSTGRES_MAX_CONNECTIONS=100 From dfc4f00f4f4f7b6b4f590c578a6b23db14f5021c Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:11:41 +0330 Subject: [PATCH 7/7] fix typo Co-authored-by: Amin Vakil --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 7dbbd9ffcfb..8e54a3df2c9 100644 --- a/.env +++ b/.env @@ -15,5 +15,5 @@ HEALTHCHECK_INTERVAL=30s HEALTHCHECK_TIMEOUT=1m30s HEALTHCHECK_RETRIES=10 # Caution: Raising max connections of postgres increases CPU and RAM usage -# see https://github.com/getsentry/self-hosted/pull/2740 for more +# see https://github.com/getsentry/self-hosted/pull/2740 for more information POSTGRES_MAX_CONNECTIONS=100