mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 16:58:46 -03:30
Add a section for postgres max_connections value (#14482)
This commit is contained in:
@@ -268,6 +268,36 @@ It is recommended to set this value higher than ``work_mem``; this can improve p
|
|||||||
|
|
||||||
Total RAM * 0.05
|
Total RAM * 0.05
|
||||||
|
|
||||||
|
Max Connections
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
For a realistic method of determining a value of ``max_connections``, a ballpark formula for AWX is outlined here.
|
||||||
|
Database connections will scale with the number of control and hybrid nodes.
|
||||||
|
Per-node connection needs are listed here.
|
||||||
|
|
||||||
|
* Callback Receiver workers: 4 connections per node or the number of CPUs per node, whichever is larger
|
||||||
|
* Dispatcher Workers: instance (forks) capacity plus 7
|
||||||
|
* uWSGI workers: 16 connections per node
|
||||||
|
* Listeners and auxiliary services: 4 connections per node
|
||||||
|
* Reserve for installer and other actions: 5 connections in total
|
||||||
|
|
||||||
|
Each of these points represent maximum expected connection use in high-load circumstances.
|
||||||
|
To apply this, consider a cluster with 3 hybrid nodes, each with 8 CPUs and 16 GB of RAM.
|
||||||
|
The capacity formula will determine a capacity of 132 forks per node based on the memory and capacity formula.
|
||||||
|
|
||||||
|
(3 nodes) x (
|
||||||
|
(8 CPUs / node) x (1 connection / CPU) +
|
||||||
|
(132 forks / node) x (1 connection / fork) + (7 connections / node) +
|
||||||
|
(16 connections / node) +
|
||||||
|
(4 connections / node)
|
||||||
|
) + (5 connections)
|
||||||
|
|
||||||
|
Adding up all the components comes out to 506 for this example cluster.
|
||||||
|
Practically, this means that the max_connections should be set to something higher than this.
|
||||||
|
Additional connections should be added to account for other platform components.
|
||||||
|
|
||||||
|
This calculation is most sensitive to the number of forks per node. Database connections are briefly opened at the start of and end of jobs. Environments where bursts of many jobs start at once will be most likely to reach the theoretical max number of open database connections.
|
||||||
|
The max number of jobs that would be started concurrently can be adjusted by modifying the effective capacity of the instances. This can be done with the SYSTEM_TASK_ABS_MEM setting, the capacity adjustment on instances, or with instance groups max jobs or max forks.
|
||||||
|
|
||||||
AWX Settings
|
AWX Settings
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
Reference in New Issue
Block a user