File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed
Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ postgresql_data_dir: /var/lib/pgsql/data
99
1010postgresql_admin_password : " CHANGEME"
1111
12- postgresql_max_connections : 500
13- postgresql_shared_buffers : 512MB
14- postgresql_effective_cache_size : 1GB
12+ postgresql_pulp_connections_count : " {{ pulp_worker_count + pulp_content_service_worker_count + pulp_api_service_worker_count }}"
13+
14+ postgresql_max_connections : " {{ ( postgresql_pulp_connections_count | int + ( foreman_puma_workers | int * foreman_database_pool | int ) / 250 ) | round(0, 'ceil') | int * 250 }}"
15+ postgresql_shared_buffers : " {{ ( ansible_facts['memtotal_mb'] / 8192 ) | round(0, 'ceil') | int }}GB"
16+ postgresql_effective_cache_size : " {{ ( ansible_facts['memtotal_mb'] / 4096 ) | round(0, 'ceil') | int }}GB"
Original file line number Diff line number Diff line change @@ -5,10 +5,6 @@ pulp_api_image: "{{ pulp_container_image }}:{{ pulp_container_tag }}"
55pulp_content_image : " {{ pulp_container_image }}:{{ pulp_container_tag }}"
66pulp_worker_image : " {{ pulp_container_image }}:{{ pulp_container_tag }}"
77
8- pulp_worker_count : " {{ [8, ansible_facts['processor_nproc']] | min }}"
9- pulp_content_service_worker_count : " {{ (2 * ([8, ansible_facts['processor_nproc']] | min)) + 1 }}"
10- pulp_api_service_worker_count : " {{ ([4, ansible_facts['processor_nproc']] | min) + 1 }}"
11-
128pulp_volumes :
139 - /var/lib/pulp:/var/lib/pulp
1410
Original file line number Diff line number Diff line change @@ -5,3 +5,20 @@ tuning_profile: development
55flavor : katello
66features : []
77enabled_features : " {{ (flavor_features + features) }}"
8+
9+ pulp_worker_count : " {{ [8, ansible_facts['processor_nproc']] | min }}"
10+ pulp_content_service_worker_count : " {{ (2 * ([8, ansible_facts['processor_nproc']] | min)) + 1 }}"
11+ pulp_api_service_worker_count : " {{ ([4, ansible_facts['processor_nproc']] | min) + 1 }}"
12+
13+ # Puma threads calculation:
14+ # Max calculation is based on the default for MRI https://puma.io/puma6/#thread-pool
15+ # Min calculation is based on testing that showed that having the same value as the max led to
16+ # lower memory usage
17+ foreman_puma_threads_max : 5
18+ # Puma workers calculation:
19+ # CPU calculation is based on https://github.com/puma/puma/blob/master/docs/deployment.md#mri
20+ # Memory calculation is based on https://docs.gitlab.com/ee/install/requirements.html#puma-settings
21+ foreman_puma_workers : " {{ [32, ansible_facts['processor_nproc'] * 1.5, (ansible_facts['memtotal_mb'] / 1024) - 1.5] | min | int }}"
22+
23+ # Database pool calculation is based on https://community.theforeman.org/t/rails-connection-pool-size-optimizations/36675
24+ foreman_database_pool : " {{ foreman_puma_threads_max | int + 4 }}"
You can’t perform that action at this time.
0 commit comments