[Satellite6] How to change number of pulp workers?

Solution Verified - Updated -

Environment

  • Red Hat Satellite or Capsule 6

Issue

  • there is a need to adjust number of worker processes in pulp
    • default value is number of processors on the machine
  • how to do that?

Resolution

Do NOT follow this tuning until specifically requested by Red Hat Support. Misconfiguring pulp might have negative impact to performance or stability of pulp server within Satellite or Capsule.

The below procedure works for Satellite as well as Capsule. To set e.g. 8 worker processes on each installer run:

  • edit /etc/foreman-installer/custom-hiera.yaml and add this line:

    • For Satellite/Capsule 6.3:
    katello::num_pulp_workers: "8"
    
    • For Satellite/Capsule 6.4:
    pulp::num_pulp_workers: "8"
    
  • apply the setting:

satellite-installer

Temporary change the number of workers, until next installer run reverts the change

  • edit /etc/default/pulp_workers and place there:
PULP_CONCURRENCY=8
  • to apply the change, restart all pulp services:
for i in pulp_resource_manager pulp_workers pulp_celerybeat; do service $i restart; done

IMPORTANT

  • In case one decreases pulp worker processes, be aware of this pulp upstream bug. To workaround it, first stop all pulp services, ensure no process with celery in the command line is running (ps aux | grep python | grep -c celery returns 0), apply the change and then start the processes again.
  • Be careful of increasing pulp workers to more than 8 even if server having more than 8 CPU's since I/O could become a bottleneck, esp. when other I/O demanding features are concurrently used. If required to have more workers than 8, it is recommended to experiment with e.g. 10 workers, check possible impact, then increase to 12 and see if I/O becomes a problem etc.

Diagnostic Steps

  • With a system with less than 8 CPUs, PULP_CONCURRENCY is set to the number of CPUs. With a system with more than 8 CPUs, it is set to 8.
FROM /usr/share/katello-installer-base/pulp/spec/classes/pulp_config_spec.rb


    describe 'with processor count less than 8' do

      it "should set the PULP_CONCURRENCY to the processor count" do
        should contain_file('/etc/default/pulp_workers').with_content(/^PULP_CONCURRENCY=3$/)
      end

    end

    describe 'with processor count more than 8' do
      let :facts do
        default_facts.merge({
          :processorcount => 12
        })
      end

      it "should set the PULP_CONCURRENCY to 8" do
        should contain_file('/etc/default/pulp_workers').with_content(/^PULP_CONCURRENCY=8$/)
      end
    end

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.