summaryrefslogtreecommitdiffstats
path: root/custom
diff options
context:
space:
mode:
authorOtto Richter <git@otto.splvs.net>2024-04-23 00:41:52 +0200
committerOtto Richter <git@otto.splvs.net>2024-04-23 00:47:50 +0200
commitf23fd221e4f8c68eb7f3be3411f71ad93e23ac97 (patch)
tree1b8d6aede549a6fa5f5ee131106d11686970b7fc /custom
parentMerge pull request 'Fix dropdown text ellipsis (#30628) (#30633)' (#3372) fro... (diff)
downloadforgejo-f23fd221e4f8c68eb7f3be3411f71ad93e23ac97.tar.xz
forgejo-f23fd221e4f8c68eb7f3be3411f71ad93e23ac97.zip
Limit database max connections by default
Our default of unlimited database connections is not sane, because every database has a limit, and our default should just follow this. Otherwise it will lead to issues every time a small instance gets a high traffic peak. Part of https://codeberg.org/forgejo/forgejo/issues/3381 The value of 100 is the lowest value from: - 100 Postgres https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS - 151 MySQL https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_connections - 151 MariaDB https://mariadb.com/docs/server/ref/mdb/system-variables/max_connections/
Diffstat (limited to 'custom')
-rw-r--r--custom/conf/app.example.ini4
1 files changed, 2 insertions, 2 deletions
diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini
index 23b41e0853..4eee2cd1ff 100644
--- a/custom/conf/app.example.ini
+++ b/custom/conf/app.example.ini
@@ -407,8 +407,8 @@ USER = root
;; Database connection max life time, default is 0 or 3s mysql (See #6804 & #7071 for reasoning)
;CONN_MAX_LIFETIME = 3s
;;
-;; Database maximum number of open connections, default is 0 meaning no maximum
-;MAX_OPEN_CONNS = 0
+;; Database maximum number of open connections, default is 100 which is the lowest default from Postgres (MariaDB + MySQL default to 151). Ensure you only increase the value if you configured your database server accordingly.
+;MAX_OPEN_CONNS = 100
;;
;; Whether execute database models migrations automatically
;AUTO_MIGRATION = true