Bug 2091190

Summary: [RFE] Verify that the number of krb5kdc worker processes is aligned to the number of configured CPUs
Product: Red Hat Enterprise Linux 9 Reporter: Rob Crittenden <rcritten>
Component: ipa-healthcheckAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: fcami, ipa-qe, mpolovka, myusuf, tscherf
Target Milestone: betaKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-healthcheck-0.12-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2052930 Environment:
Last Closed: 2023-05-09 07:52:26 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: 2052930    
Bug Blocks:    

Description Rob Crittenden 2022-05-27 18:30:23 UTC
+++ This bug was initially created as a clone of Bug #2052930 +++

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 2 Michal Polovka 2022-12-21 11:39:42 UTC
ipa-healthcheck-0.12-1.el9.noarch on RHEL9.2 machine

# python3 -m pytest -vvv tests/test_ipa_kdc.py 
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.16, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/freeipa-healthcheck
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.44s ======================================================================================


Therefore marking as pre-verified tested.

Comment 6 Michal Polovka 2023-02-08 18:03:14 UTC
Verified using ipa-healthcheck-0.12-1.el9.noarch on RHEL9.2 machine

# python3 -m pytest tests/test_ipa_kdc.py -vvv
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.16, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/freeipa-healthcheck
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.37s ======================================================================================

Marking as verified.

Comment 8 errata-xmlrpc 2023-05-09 07:52:26 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 (ipa-healthcheck 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:2381