Merge ~blake-rouse/maas:lower-max-conns-per-worker-2.2 into maas:2.2

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: 37a8a6263f297a07d121cd527a8361956e516226
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~blake-rouse/maas:lower-max-conns-per-worker-2.2
Merge into: maas:2.2
Diff against target: 20 lines (+8/-1)
1 file modified
src/maasserver/utils/threads.py (+8/-1)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+327129@code.launchpad.net

Commit message

Backport #1703403: Lower the maximum number of connections per worker to 9 connections is allowed as 1 is reserved for the .

Allowing each worker to have a maximum of 10 connections open at a time. A region controller with 4 workers will use a maximum of 40 connections. This allows 2 region controllers to run without needing to increase the maximum number of PostgreSQL connection (default is 100 connections).

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Self-approving backport.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/utils/threads.py b/src/maasserver/utils/threads.py
2index 0528d12..38a847b 100644
3--- a/src/maasserver/utils/threads.py
4+++ b/src/maasserver/utils/threads.py
5@@ -38,7 +38,14 @@ from twisted.internet.defer import DeferredSemaphore
6
7
8 max_threads_for_default_pool = 50
9-max_threads_for_database_pool = 20
10+
11+# Maximum number of database connections this worker can use. 9 connections is
12+# allowed as 1 is reserved for the `PostgresListener`. Allowing each worker to
13+# have a maximum of 10 connections open at a time. A region controller with
14+# 4 workers will use a maximum of 40 connections. This allows 2 region
15+# controllers to run without needing to increase the maximum number of
16+# PostgreSQL connection (default is 100 connections).
17+max_threads_for_database_pool = 9
18
19
20 def make_default_pool(maxthreads=max_threads_for_default_pool):

Subscribers

People subscribed via source and target branches