Bug 56628 - UDM user/group creation takes very long if univentionLastUsedValue is not in sync since uidNumber/gidNumber uniqueness
UDM user/group creation takes very long if univentionLastUsedValue is not in ...
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-19 16:06 CEST by Florian Best
Modified: 2023-11-13 08:45 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
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 Florian Best univentionstaff 2023-09-19 16:06:12 CEST
After creating a new UCS system we have two different values for the uidNumber or gidNumber last used value counter:

# univention-ldapsearch -LLL univentionLastUsedValue=* univentionLastUsedValue
dn: cn=gidNumber,cn=temporary,cn=univention,dc=school,dc=dev
univentionLastUsedValue: 5009

dn: cn=uidNumber,cn=temporary,cn=univention,dc=school,dc=dev
univentionLastUsedValue: 2015

After creating 3000 users the values are similar equal but a new user or group creation will not update the other value.

After creating another N thousand users but not group we have a large delta, e.g.:
# univention-ldapsearch -LLL univentionLastUsedValue=* univentionLastUsedValue                                                                                                                                                 
dn: cn=gidNumber,cn=temporary,cn=univention,dc=school,dc=dev
univentionLastUsedValue: 5009

dn: cn=uidNumber,cn=temporary,cn=univention,dc=school,dc=dev
univentionLastUsedValue: 28825

for ((i=10; i<=70000; i++)); do udm users/user create --set password=univention --set lastname=foo --set username="test$i" --position=cn=users,dc=school,dc=dev; done

When a group is then created it counts up until a free gidNumber/uidNumber is found and for each value it makes a ldap search.
Therefore 23816 searches are done.

# time udm groups/group create --set name=group4
WARNING: The object is not going to be created underneath of its default containers.
Object created: cn=group4,dc=school,dc=dev

real    3m22,399s
user    0m0,065s
sys     0m0,016s

With more than 70000 users this gets into a timeout when using the UDM REST API for creating the group (takes probably longer than 10 minutes).

→ we should update univentionLastUsedValue both in uidNumber and gidNumber if they don't have a large diff and UCRv directory/manager/uid_gid/uniqueness is not false. But the range for the first groups between 2015 and 5009 should still be used.