Bug 2052930

Summary: [RFE] Verify that the number of krb5kdc worker processes is aligned to the number of configured CPUs
Product: Red Hat Enterprise Linux 8 Reporter: Thorsten Scherf <tscherf>
Component: ipa-healthcheckAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: ---CC: fcami, mpolovka, rjeffman
Target Milestone: pre-dev-freezeKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-healthcheck-0.12-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2091190 (view as bug list) Environment:
Last Closed: 2023-05-16 08:28:45 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:
Bug Depends On:    
Bug Blocks: 2091190    

Description Thorsten Scherf 2022-02-10 09:59:36 UTC
Description of problem:

There was recently a case where a customer was complaining about krb5kdc process, as part of the IdM framework, not answering all client requests when the load on the service increased. It turned out that increasing the number of krb5kdc worker processes helped to resolve this issue.

Now, there is already code available [1] that auto-detects the  number of online CPUs and then sets the number of krb5kdc worker threads dynamically.  It relies on SC_NPROCESSORS_ONLN sysconf value. The system configuration can easily change though after the initial setup. Especially in virtual environments it's quite common to add or remove the number of virtual CPUs based on the actual requirements. As a result the number of configured krb5kdc worker processes might not be aligned anymore with the number of available CPUs configured on the system.

The ask is to implement an IPA healtcheck rule to verify the number of configured krb5kdc worker processes is aligned with the number of available CPUs.

[1] https://github.com/freeipa/freeipa/commit/b67df045beccf192c9be3ba61fb68986407ae045

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Documentation BZ to highlight this configuration parameter in the IdM tuning guide:
https://bugzilla.redhat.com/show_bug.cgi?id=2052919

Comment 5 Michal Polovka 2023-01-04 13:19:30 UTC
Pre-verified on RHEL8.8 machine with ipa-healthcheck-0.12-1.module+el8.8.0+17582+6bf5bf91.noarch


# python3 -m pytest -vvv tests/test_ipa_kdc.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.6.8, pytest-3.4.2, py-1.5.3, pluggy-0.6.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/freeipa-healthcheck, inifile:
collected 6 items                                                                                                                                                                            

tests/test_ipa_kdc.py::TestKDCWorkers::test_no_workers_empty_noargs PASSED                                                                                                             [ 16%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_no_workers_noargs PASSED                                                                                                                   [ 33%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_with_workers_empty_noargs PASSED                                                                                                           [ 50%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_workers_match_double PASSED                                                                                                                [ 66%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_workers_match_single PASSED                                                                                                                [ 83%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_workers_mismatch PASSED                                                                                                                    [100%]

================================================================================== 6 passed in 0.49 seconds ==================================================================================

Marking as verified:tested.

Comment 9 Michal Polovka 2023-01-11 15:10:59 UTC
Verified using ipa-healthcheck-0.12-1.el8 on RHEL8.8 machine


# python3 -m pytest -vvv tests/test_ipa_kdc.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.6.8, pytest-3.4.2, py-1.5.3, pluggy-0.6.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/freeipa-healthcheck, inifile:
collected 6 items                                                                                                                                                                            

tests/test_ipa_kdc.py::TestKDCWorkers::test_no_workers_empty_noargs PASSED                                                                                                             [ 16%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_no_workers_noargs PASSED                                                                                                                   [ 33%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_with_workers_empty_noargs PASSED                                                                                                           [ 50%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_workers_match_double PASSED                                                                                                                [ 66%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_workers_match_single PASSED                                                                                                                [ 83%]
tests/test_ipa_kdc.py::TestKDCWorkers::test_workers_mismatch PASSED                                                                                                                    [100%]

================================================================================== 6 passed in 0.46 seconds ==================================================================================


Therefore marking as verified.

Comment 11 errata-xmlrpc 2023-05-16 08:28:45 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 (idm:client and idm:DL1 bug fix and enhancement 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/RHBA-2023:2794