mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-01-19 11:57:56 +08:00
do not go lower than 100 connections
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
00ec781b68
commit
416f50b70c
1 changed files with 4 additions and 0 deletions
|
@ -152,6 +152,10 @@ if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then
|
|||
MEMORY=$(awk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo)
|
||||
MAX_CONNECTIONS=$((MEMORY/50+3))
|
||||
if [ -n "$MAX_CONNECTIONS" ]; then
|
||||
# 100 is the default, we do not want to go lower than this
|
||||
if [ "$MAX_CONNECTIONS" -lt 100 ]; then
|
||||
MAX_CONNECTIONS=100
|
||||
fi
|
||||
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue