mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
postgresql - close idling sessions automatically
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
c8c6bda76e
commit
00ec781b68
1 changed files with 5 additions and 1 deletions
|
|
@ -155,10 +155,14 @@ if [ -f "/var/lib/postgresql/data/postgresql.conf" ]; then
|
||||||
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
|
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Modify conf
|
# Do not log checkpoints
|
||||||
if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then
|
if grep -q "#log_checkpoints" /var/lib/postgresql/data/postgresql.conf; then
|
||||||
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf
|
sed -i 's|#log_checkpoints.*|log_checkpoints = off|' /var/lib/postgresql/data/postgresql.conf
|
||||||
fi
|
fi
|
||||||
|
# Close idling connections automatically after 3s which does not seem to happen automatically so that we run into max_connections limits
|
||||||
|
if grep -q "#idle_session_timeout" /var/lib/postgresql/data/postgresql.conf; then
|
||||||
|
sed -i 's|#idle_session_timeout.*|idle_session_timeout = 3000|' /var/lib/postgresql/data/postgresql.conf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Catch docker stop attempts
|
# Catch docker stop attempts
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue