Bug 52292 - With many users access to udm/users via UMC is very slow (if no "unlimited" license key is in place)
With many users access to udm/users via UMC is very slow (if no "unlimited" l...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.4
Other Linux
: P5 normal with 2 votes (vote)
: UCS 5.0-1-errata
Assigned To: Peter Stoll
Dirk Wiesenthal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-02 12:13 CET by Bernhard M. Wiedemann
Modified: 2022-03-23 14:14 CET (History)
7 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 1: Cosmetic issue or missing function but workaround exists
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.017
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020111221000317, 2021101421000261
Bug group (optional): Large environments, UCS Performance
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard M. Wiedemann 2020-11-02 12:13:08 CET
With UCS 4.4-6 errata 767

When I log into the univention web-interface and go to

https://.../univention/management/#module=udm:users/user:0:

it takes a minute until the page is loaded and all other web-interface operations are blocked during that period.


in top I can see
slapd at 100-170% CPU for a minute or two

/usr/lib/univention-pam/ldap-group-to-file.py --check_member at 30% CPU for a minute

/usr/sbin/univention-management-console-module -m udm -s /var/run/univention-management-console/634-1604314966079.socket -d 2 -l en_US.UTF-8  at 8% CPU for a minute


The delay occurs only once per login.
On our similar 4.4-4 setup, this problem does not occur, but there may be some differences between these setups, so it is unclear whether this is a regression.
Comment 3 Dirk Schnick univentionstaff 2020-11-19 08:03:59 CET
The customer further tested. It actual looks that the customization is responsible for the delay. PS is actual checking what is going on there.

I would like to keep the bug open in the status need more info if the analysis finds something in the product.
Comment 4 Dirk Schnick univentionstaff 2021-01-05 11:56:36 CET
The reason was a license file with 100.000 Users. Solved by unlimited users.
Comment 5 Florian Best univentionstaff 2021-01-05 14:16:18 CET
(In reply to Dirk Schnick from comment #4)
> The reason was a license file with 100.000 Users. Solved by unlimited users.

So, a system with multiple thousand users and a license which allows only a specific number of users causes a performance issue.
The reason is the license check executed when opening the UDM module.
The code for the check is here: https://git.knut.univention.de/univention/ucs/-/blob/4.4-7/management/univention-directory-manager-modules/modules/univention/admin/license.py#L398-407

→ We should enhance the User filter. It can nowadays be simplified to '(univentionObjectType=users/user)'
Comment 6 Arvid Requate univentionstaff 2021-01-05 17:57:15 CET
Alternative proposed by Daniel:

> I suggest to maintain a cache with the query result using a background
> task started by the UMC login and have UDM use the cache.
> A listener module would be better, but could only be used, if it'd be OK
> to add/mod objects while the replication is ongoing/delayed.
Comment 8 Benjamin Fels univentionstaff 2021-10-14 14:02:30 CEST
Big customer affected, worked around with unlimited key
Comment 10 Ingo Steuwer univentionstaff 2021-11-22 14:36:12 CET
(In reply to Arvid Requate from comment #6)
> Alternative proposed by Daniel:
> 
> > I suggest to maintain a cache with the query result using a background
> > task started by the UMC login and have UDM use the cache.
> > A listener module would be better, but could only be used, if it'd be OK
> > to add/mod objects while the replication is ongoing/delayed.

AFAIK we already have sort of a cache for the internal user statistics.
Comment 12 Peter Stoll univentionstaff 2022-03-21 18:07:54 CET
91acda00cf Bug #52292: Enhance LDAP filter for user_account
cd3e72bc77 Bug #52292: Enhance LDAP filter for user_account, incorporate QA comments
998df6a1a1 Bug #52292 Updated YAML for univention-directory-manager-modules
Comment 13 Dirk Wiesenthal univentionstaff 2022-03-22 16:03:23 CET
query in license.py and users/user.py are equal: OK
manual tests: OK
Performance: 30% improvement
VERIFIED