Bug 55120 - univention-group-membership-cache consumes CPU 100%
univention-group-membership-cache consumes CPU 100%
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 5.0
Other Linux
: P5 major (vote)
: UCS 5.0-2-errata
Assigned To: Dirk Wiesenthal
Julia Bremer
:
Depends on: 54497
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-22 13:59 CEST by Nikola Radovanovic
Modified: 2022-10-11 16:29 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.086
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022081821000211, 2022082221000168
Bug group (optional): Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikola Radovanovic univentionstaff 2022-08-22 13:59:08 CEST
After latest update (2.0.0-7), customers noticed that portal update consumes 100% of CPU core for the process:
  /usr/bin/python3  /usr/sbin/univention-portal  update --reason  ldap:group
Comment 3 Dirk Wiesenthal univentionstaff 2022-08-24 10:39:10 CEST
Fixed in

Package: univention-group-membership-cache
Version: 2.0.0-11A~5.0.0.202208241026
Branch: ucs_5.0-0
Scope: errata5.0-2

univention-group-membership-cache.yaml
dcc5074b4ebf | Bug #55120: YAML
841977010152 | Bug #55120: YAML
93ac9fbd9182 | Bug #55120: Advisory update
23f3e98e5f3f | Bug #55120: univention-group-membership-cache consumes CPU 100%

univention-group-membership-cache (2.0.0-9)
eb3bdda6ba24 | Bug #55120: Fix users_groups

univention-group-membership-cache (2.0.0-8)
23f3e98e5f3f | Bug #55120: univention-group-membership-cache consumes CPU 100%

univention-group-membership-cache (2.0.0-11)
11be9633aaa3 | Bug #55120: Fix load()

univention-group-membership-cache (2.0.0-10)
3fa76696b62a | Bug #55120: Improve performance


We basically switched in the internal function of the ldap_cache's users_groups from groups_for_user to users_in_group.

We found that for specific user/group data, despite operating on in-memory dictionaries and sets only, groups_for_user is much slower than users_in_group (which queries the database).

We saw improvements from >2000s to <5s for very large environments.
Comment 4 Julia Bremer univentionstaff 2022-08-24 14:49:43 CEST
OK: Group cache still generates the correct group lists
OK: Groups in groups
OK: Portal tile visibly depending on groups in cache
OK: Performance with many users (~3 seconds with 200k users)
OK: Performance with many groups and lots of groups in groups (Has been tested in customer environments)
OK: Yaml
OK: Tests (Have been fixed today, so no official run, but I ran them successfully  in a Jenkins environment)

Verified