Bug 2244370

Summary: default tuning profile leaves httpd MaxClients 150 which httpd raises a warning
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.13.0CC: ahumbe, dhjoshi, egolov, ehelms, ekohlvan, gformisa, jpathan, lpramuk, pdwyer
Target Milestone: 6.15.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-installer-3.9.0-0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2257330 (view as bug list) Environment:
Last Closed: 2024-04-23 17:15:14 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 Pavel Moravec 2023-10-16 08:06:28 UTC
Description of problem:
Having Satellite or (mainly) Capsule with default tuning profile, /etc/httpd/conf.modules.d/event.conf is configured with

  MaxClients             150

That leads to raising a warning during httpd start:

Oct 16 09:18:49 pmoravec-caps612.gsslab.brq2.redhat.com httpd[1076]: AH00513: WARNING: MaxRequestWorkers of 150 is not an integer multiple of ThreadsPerChild of 16, decreasing to nearest multiple 144, for a maximum of 9 servers.

which can raise alarms at or confuse customers.

Any tuning profile starting from medium does bump this value to 1024:

/usr/share/foreman-installer/config/foreman.hiera/tuning/sizes/extra-extra-large.yaml:apache::mod::event::maxrequestworkers: 1024
/usr/share/foreman-installer/config/foreman.hiera/tuning/sizes/extra-large.yaml:apache::mod::event::maxrequestworkers: 1024
/usr/share/foreman-installer/config/foreman.hiera/tuning/sizes/large.yaml:apache::mod::event::maxrequestworkers: 1024
/usr/share/foreman-installer/config/foreman.hiera/tuning/sizes/medium.yaml:apache::mod::event::maxrequestworkers: 1024

but the default keeps undefined:

/usr/share/foreman-installer/modules/apache/manifests/mod/event.pp:  Optional[Variant[Integer, Boolean]] $maxrequestworkers      = undef,

causing the default 150 is not overwritten.

Please adjust also the default profile to use something dividable by 16.


Version-Release number of selected component (if applicable):
Sat&Caps 6.12+ (probably also older)


How reproducible:
100%


Steps to Reproduce:
1. Install a Caps or Sat without tuning profile
2. journalctl --unit httpd.service -a --no-pager


Actual results:
2. shows the WARNING above


Expected results:
2. no such warning


Additional info:
The default 150 value is harmless, just the warning can cause confusion.

Comment 1 Eric Helms 2023-10-19 12:41:49 UTC
This needs further investigation and consideration to raise the default to a reasonable value.

https://httpd.apache.org/docs/current/mod/mpm_common.html#maxrequestworkers

Comment 2 Ewoud Kohl van Wijngaarden 2023-10-19 13:09:50 UTC
This came from https://github.com/puppetlabs/puppetlabs-apache/blob/6023b4048b11c72e84efe1a300090345e638f0d9/manifests/mod/event.pp#L51

Since puppetlabs-apache 9.0.0 there is no default, so the Apache built in one is used. If I read it right, that should be 400 (16 * 25). I don't know if raising ServerLimit automatically increases the effective value for MaxRequestWorkers, or if the default of MaxRequestWorkers is hardcoded to 16 * 25. The documentation is suggests it wouldn't, but as a user I would expect it to.

Foreman 3.8 is the first version to ship puppetlabs-apache 9+ so I suspect the latest upstream is not affected by this BZ and fixing it requires a stable-branch only change.

Comment 4 Ewoud Kohl van Wijngaarden 2023-10-19 15:50:48 UTC
I've submitted a PR in upstream against 3.7-stable: https://github.com/theforeman/foreman-installer/pull/896

In there I've chosen to set it to false, causing the code to not set any value for MaxClients anymore. httpd should fall back to its internal defaults.

Comment 5 Brad Buckingham 2023-10-23 12:16:03 UTC
Moving to POST as the PR mentioned in comment 4 has been merged upstream.

Comment 6 Brad Buckingham 2023-10-30 11:29:29 UTC
Bulk setting Target Milestone = 6.15.0 where sat-6.15.0+ is set.

Comment 9 Lukas Pramuk 2023-12-13 15:56:49 UTC
VERIFIED.

@Satellite 6.15.0 Snap 2.1
foreman-installer-3.9.0-0.3.rc3.el8sat.noarch

by the following reproducer:

# grep -rn MaxClients /etc/httpd/
<empty>

>>> MaxClients is not set explicitly and relying on httpd defaults

# journalctl --unit httpd.service -a --no-pager | grep WARNING
<empty>

>>> there is no WARNING in the journal

Comment 12 errata-xmlrpc 2024-04-23 17:15:14 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 (Important: Satellite 6.15.0 release), 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-2024:2010