mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
set max connections and max php children based on available hardware
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
b307c39f70
commit
5804f68824
4 changed files with 18 additions and 6 deletions
|
|
@ -110,6 +110,11 @@ if ! [ -f "$DATADIR/PG_VERSION" ] && ! [ -f "$DUMP_FILE" ]; then
|
|||
rm -rf "${DATADIR:?}/"*
|
||||
fi
|
||||
|
||||
echo "Setting max connections..."
|
||||
MEMORY=$(mawk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo)
|
||||
MAX_CONNECTIONS=$((MEMORY/50+3))
|
||||
sed -i "s|^max_connections =.*|max_connections = $MAX_CONNECTIONS|" "/var/lib/postgresql/data/postgresql.conf"
|
||||
|
||||
# Catch docker stop attempts
|
||||
trap 'true' SIGINT SIGTERM
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue