@@ -5,3 +5,32 @@ tuning_profile: development
55flavor : katello
66features : []
77enabled_features : " {{ (flavor_features + features) }}"
8+
9+ # XXX: This number is the highest we've seen in our testing and needs to be explained
10+ candlepin_connection_count : 25
11+
12+ # Puma threads calculation:
13+ # Max calculation is based on the default for MRI https://puma.io/puma6/#thread-pool
14+ # Min calculation is based on testing that showed that having the same value as the max led to
15+ # lower memory usage
16+ foreman_puma_threads_max : 5
17+ # Puma workers calculation:
18+ # CPU calculation is based on https://github.com/puma/puma/blob/master/docs/deployment.md#mri
19+ # Memory calculation is based on https://docs.gitlab.com/ee/install/requirements.html#puma-settings
20+ foreman_puma_workers : " {{ [32, ansible_facts['processor_nproc'] * 1.5, (ansible_facts['memtotal_mb'] / 1024) - 1.5] | min | int }}"
21+ # Database pool calculation is based on https://community.theforeman.org/t/rails-connection-pool-size-optimizations/36675
22+ # The number 4 is for 4 threads that are spawned internally during the execution:
23+ # 1. Katello event daemon listener
24+ # 2. Katello event monitor poller
25+ # 3. Stomp listener (required by Katello)
26+ # 4. Puma server listener thread
27+ # This means for systems without Katello we can reduce the amount of the pool to foreman_puma_threads_max + 1
28+ foreman_database_pool : " {{ foreman_puma_threads_max | int + 4 }}"
29+ foreman_connection_count : " {{ foreman_puma_workers | int * foreman_database_pool | int }}"
30+
31+ pulp_worker_count : " {{ [8, ansible_facts['processor_nproc']] | min }}"
32+ pulp_content_service_worker_count : " {{ (2 * ([8, ansible_facts['processor_nproc']] | min)) + 1 }}"
33+ pulp_api_service_worker_count : " {{ ([4, ansible_facts['processor_nproc']] | min) + 1 }}"
34+ pulp_connection_count : " {{ pulp_worker_count | int + pulp_content_service_worker_count | int + pulp_api_service_worker_count | int }}"
35+
36+ postgresql_connection_count : " {{ candlepin_connection_count | int + foreman_connection_count | int + pulp_connection_count | int }}"
0 commit comments