You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #3922 - ferrous-systems:split-db-pool-size-env-vars, r=pietroalbini
Split DB_POOL_SIZE & DB_MIN_IDLE environment variables
This PR splits the existing environment variables `DB_POOL_SIZE` & `DB_MIN_IDLE` into separate variables to provide different connection settings to the primary & replica databases. The main reason for this change is to be able to configure different values for both database pools.
The new env variables are:
* `DB_PRIMARY_POOL_SIZE` & `DB_REPLICA_POOL_SIZE` to configure the number of connections in the primary & replica pool
* `DB_PRIMARY_MIN_IDLE` & `DB_REPLICA_MIN_IDLE` to set the number of idle connections each pool at least maintains
* update descriptions of env vars.
**Note** the descriptions of the `*_POOL_SIZE` variables in `app.json` are most likely off & need correct wording.
Copy file name to clipboardExpand all lines: app.json
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,25 @@
23
23
"value": "",
24
24
"required": false
25
25
},
26
-
"DB_POOL_SIZE": {
26
+
"DB_PRIMARY_POOL_SIZE": {
27
27
"value": "10",
28
28
"required": false,
29
-
"description": "The maximum number of database connections managed by the pool. Set so that this value times the number of dynos is less than your connection limit."
29
+
"description": "The maximum number of primary database connections managed by the pool. Set so that this value times the number of dynos is less than your connection limit."
30
30
},
31
-
"DB_MIN_IDLE": {
31
+
"DB_REPLICA_POOL_SIZE": {
32
+
"value": "3",
33
+
"required": false,
34
+
"description": "The maximum number of replica database connections managed by the pool. Set so that this value times the number of dynos is less than your connection limit."
35
+
},
36
+
"DB_PRIMARY_MIN_IDLE": {
32
37
"value": "5",
33
38
"required": false,
34
-
"description": "The pool will try to maintain at least this many idle connections at all times, while respecting the maximum size of the pool."
39
+
"description": "The pool will try to maintain at least this many idle connections on the primary database at all times, while respecting the maximum size of the pool."
40
+
},
41
+
"DB_REPLICA_MIN_IDLE": {
42
+
"value": "1",
43
+
"required": false,
44
+
"description": "The pool will try to maintain at least this many idle connections on the replica database at all times, while respecting the maximum size of the pool."
0 commit comments