From e10ae4d0a773751fee44ecf2379f463bb4287e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Wed, 24 Feb 2021 18:50:01 +0100 Subject: [PATCH] [__matrix_synapse] Wire parameters for PGSQL pool size --- type/__matrix_synapse/files/homeserver.yaml.sh | 2 ++ type/__matrix_synapse/man.rst | 6 ++++++ type/__matrix_synapse/manifest | 4 +++- .../parameter/default/database-connection-pool-max | 1 + .../parameter/default/database-connection-pool-min | 1 + type/__matrix_synapse/parameter/optional | 2 ++ 6 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 type/__matrix_synapse/parameter/default/database-connection-pool-max create mode 100644 type/__matrix_synapse/parameter/default/database-connection-pool-min diff --git a/type/__matrix_synapse/files/homeserver.yaml.sh b/type/__matrix_synapse/files/homeserver.yaml.sh index 0ad3c42..bc94391 100755 --- a/type/__matrix_synapse/files/homeserver.yaml.sh +++ b/type/__matrix_synapse/files/homeserver.yaml.sh @@ -835,6 +835,8 @@ database: host: "${DATABASE_HOST:?}" user: "${DATABASE_USER:?}" password: "$DATABASE_PASSWORD" + cp_min: ${DATABASE_CP_MIN:?} + cp_min: ${DATABASE_CP_MAX:?} EOF ;; *) diff --git a/type/__matrix_synapse/man.rst b/type/__matrix_synapse/man.rst index e693809..a951d24 100644 --- a/type/__matrix_synapse/man.rst +++ b/type/__matrix_synapse/man.rst @@ -39,6 +39,12 @@ database-user database-password Database password, only used with PostgresSQL. +database-connection-pool-min + The minimum number of connections in pool, defaults to 3. + +database-connection-pool-max + The maximum number of connections in pool, defaults to 5. + ldap-uri Address of your LDAP server. diff --git a/type/__matrix_synapse/manifest b/type/__matrix_synapse/manifest index 91e92a1..055fc81 100755 --- a/type/__matrix_synapse/manifest +++ b/type/__matrix_synapse/manifest @@ -143,8 +143,10 @@ DATABASE_NAME=$(cat "$__object/parameter/database-name") DATABASE_HOST=$(cat "$__object/parameter/database-host") DATABASE_USER=$(cat "$__object/parameter/database-user") DATABASE_PASSWORD=$(cat "$__object/parameter/database-password") +DATABASE_CP_MIN=$(cat "$__object/parameter/database-connection-pool-min") +DATABASE_CP_MAX=$(cat "$__object/parameter/database-connection-pool-max") export DATABASE_ENGINE DATABASE_NAME DATABASE_HOST DATABASE_USER \ - DATABASE_PASSWORD + DATABASE_PASSWORD DATABASE_CP_MIN DATABASE_CP_MAX # LDAP-based authentication. if [ -f "$__object/parameter/enable-ldap-auth" ]; then diff --git a/type/__matrix_synapse/parameter/default/database-connection-pool-max b/type/__matrix_synapse/parameter/default/database-connection-pool-max new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/type/__matrix_synapse/parameter/default/database-connection-pool-max @@ -0,0 +1 @@ +5 diff --git a/type/__matrix_synapse/parameter/default/database-connection-pool-min b/type/__matrix_synapse/parameter/default/database-connection-pool-min new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/type/__matrix_synapse/parameter/default/database-connection-pool-min @@ -0,0 +1 @@ +3 diff --git a/type/__matrix_synapse/parameter/optional b/type/__matrix_synapse/parameter/optional index a616538..1378365 100644 --- a/type/__matrix_synapse/parameter/optional +++ b/type/__matrix_synapse/parameter/optional @@ -1,6 +1,8 @@ database-host database-user database-password +database-connection-pool-min +database-connection-pool-max ldap-uri ldap-base-dn ldap-uid-attribute