mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-02 10:41:59 +01:00
chore(db): change max_connections of postgres to 1024
Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
9483559d18
commit
2a6fe801bc
@ -40,8 +40,8 @@ database:
|
|||||||
# The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
|
# The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
|
||||||
max_idle_conns: 50
|
max_idle_conns: 50
|
||||||
# The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
|
# The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
|
||||||
# Note: the default number of connections is 100 for postgres.
|
# Note: the default number of connections is 1024 for postgres of harbor.
|
||||||
max_open_conns: 100
|
max_open_conns: 1000
|
||||||
|
|
||||||
# The default data volume
|
# The default data volume
|
||||||
data_volume: /data
|
data_volume: /data
|
||||||
|
@ -107,4 +107,14 @@ EOSQL
|
|||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
postgres -D $PGDATA
|
POSTGRES_PARAMETER=''
|
||||||
|
|
||||||
|
file_env 'POSTGRES_MAX_CONNECTIONS' '1024'
|
||||||
|
# The max value of 'max_connections' is 262143
|
||||||
|
if [ $POSTGRES_MAX_CONNECTIONS -le 0 ] || [ $POSTGRES_MAX_CONNECTIONS -gt 262143 ]; then
|
||||||
|
POSTGRES_MAX_CONNECTIONS=262143
|
||||||
|
fi
|
||||||
|
|
||||||
|
POSTGRES_PARAMETER="${POSTGRES_PARAMETER} -c max_connections=${POSTGRES_MAX_CONNECTIONS}"
|
||||||
|
|
||||||
|
postgres -D $PGDATA $POSTGRES_PARAMETER
|
||||||
|
Loading…
Reference in New Issue
Block a user