Bug 2036408

Summary: Change default pulp workers if RHUA has lower cpu count
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Paul Dudley <pdudley>
Component: RHUAAssignee: RHUI Bug List <rhui-bugs>
Status: CLOSED ERRATA QA Contact: Radek Bíba <rbiba>
Severity: low Docs Contact:
Priority: low    
Version: 4.0.0CC: gtanzill, pbartiko
Target Milestone: 4.4.0Keywords: Triaged
Target Release: 4.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 14:56:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paul Dudley 2021-12-31 22:20:14 UTC
Currently pulp workers are set to 8 and this is hard-coded in the `/usr/share/rhui-installer/playbooks/rhua-provision.yml` file here:
~~~
  vars:
    - pulp_workers: 8
~~~

With the minimum hardware settings from the docs of 4 cpus and 8GB memory 8 workers is likely not the best case for these systems.

It would be good if worker count could be set dynamically based on cpus present up to a certain value, perhaps something like 'if less than 8 cpus are present set the worker count to match cpus'.

Comment 1 Paul Dudley 2021-12-31 22:33:13 UTC
Pulp docs [1] state anywhere from 1-3 GB should be allocated per pulp worker. If a RHUI system of 4CPUs and 8GB memory, which still fits the requirements in the docs, is created with 8 workers and is managing many repositories we should reasonably doubt that this would be stable long-term.

[1] https://docs.pulpproject.org/pulpcore/installation/hardware-requirements.html

Adding another task to the playbook to adjust the variable helped reduce cpu count when the rhui-installer is run:
~~~
     70 
     71     - name: Set Pulp_workers to less than 8 if VCPU<8
     72       set_fact:
     73         pulp_workers: "{{ ansible_processor_vcpus }}"
     74       when: 'ansible_processor_vcpus < 8'
     75 
~~~

This is just an example of what could work before permanent changes are made, assuming the ansible fact above returns the proper cpu count.

Comment 2 Gregg Tanzillo 2022-01-26 15:16:56 UTC
It seems like initially, the documentation and/or the default number of workers should be changed so that they are in alignment.

Comment 3 Gregg Tanzillo 2022-01-26 15:29:11 UTC
Perhaps, the documentation should be changed to state the amount of RAM per worker should be 4GB. Also, at a minimum, that should be no more than 1 worker per CPU core. This is what is recommended for Pulp.

This would be in addition to implementing the suggested dynamic worker setting.

Comment 4 Radek Bíba 2023-04-24 14:02:17 UTC
RHUI 4.4 will bring an installer option to set the number of Pulp workers.

Comment 9 errata-xmlrpc 2023-05-03 14:56:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: RHUI 4.4.0 release - Security Fixes, Bug Fixes, and Enhancements Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2101