diff --git a/Containers/postgresql/start.sh b/Containers/postgresql/start.sh index 7fb3b8f1..cef78c10 100644 --- a/Containers/postgresql/start.sh +++ b/Containers/postgresql/start.sh @@ -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