templates: bump max postgres connections to 10
By default, pgxpool.Pool has 4 connections (or number of cpus if higher). Currently, we have 3 replicas, that means max 3*4=12 DB connections. The dequeue operation is actually blocking - when a worker is waiting for a job, one connection is blocked. My theory is that with 16 workers, we just don't have enough connections that causes all sorts of weird slowdowns. This commit bumps the number of connection from one replica to 10, therefore we should be at 30 connections in total. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
c6fbf589aa
commit
c3a8fc19a2
2 changed files with 6 additions and 0 deletions
|
|
@ -92,6 +92,8 @@ objects:
|
|||
key: db.password
|
||||
- name: PGSSLMODE
|
||||
value: "${PGSSLMODE}"
|
||||
- name: PGMAXCONNS
|
||||
value: "${PGMAXCONNS}"
|
||||
ports:
|
||||
- name: composer-api
|
||||
protocol: TCP
|
||||
|
|
@ -229,6 +231,9 @@ parameters:
|
|||
- description: postgres sslmode to use when connecting to the db
|
||||
name: PGSSLMODE
|
||||
value: "require"
|
||||
- description: postgres maximum connections per pod
|
||||
name: PGMAXCONNS
|
||||
value: "10"
|
||||
- description: base sso url
|
||||
name: SSO_BASE_URL
|
||||
required: true
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ pg_database = "osbuildcomposer"
|
|||
pg_user = "postgres"
|
||||
pg_password = "foobar"
|
||||
pg_ssl_mode = "disable"
|
||||
pg_max_conns = 10
|
||||
EOF
|
||||
|
||||
sudo systemctl restart osbuild-composer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue