Bug 32096 - Performance optimizations for syntax lookups
Performance optimizations for syntax lookups
Status: REOPENED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
All Linux
: P3 enhancement (vote)
: ---
Assigned To: UMC maintainers
UDM maintainers
:
Depends on: 30991 32084 34070
Blocks: 31560
  Show dependency treegraph
 
Reported: 2013-07-26 14:28 CEST by Dirk Wiesenthal
Modified: 2020-08-21 09:11 CEST (History)
11 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.046
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2014020721001793, 2020081121000871
Bug group (optional): Large environments, UCS Performance, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2013-07-26 14:28:49 CEST
Try to get as many syntax classes to not use_objects as possible!

+++ This bug was initially created as a clone of Bug #30991 +++

Opening the UDM users or computers module takes "very" long.

groups/group.py#open() does not seem to be the culprit, since a "udm users/user list --filter uid=XXXXXX" from the command line is instant (<0.5s).

"udm groups/group list" on the other hand takes 11 seconds, which matches roughly the time UMC UDM takes.

1213 groups.
No groups in groups.
No mixed hosts / users groups.
The largest group has 3572 users.
The user is member of 26 groups with 16,17²,21²,22,25,39,67,78,88,112,119³,121²,137,144,176,251,1945,2814,2872,3296,3572 members.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2014-02-07 11:58:29 CET
A customer with large environment ran into this problem. The UDM module had to be modified manually to get it fast (time difference in opening an UDM object: 
60 seconds vs. 1 second). #2014020721001793
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2014-08-22 11:35:24 CEST
(In reply to Sönke Schwardt-Krummrich from comment #1)
> A customer with large environment ran into this problem. The UDM module had
> to be modified manually to get it fast (time difference in opening an UDM
> object: 
> 60 seconds vs. 1 second). #2014020721001793

Modified customer environment again after update to UCS 3.2.
Would be great, if these optimizations will be added to UCS 4.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2016-05-11 12:13:39 CEST
Maybe Bug #34070 has to be fixed first.
Comment 4 Florian Best univentionstaff 2016-05-11 12:32:28 CEST
Is this still unfixed in UCS 4.1?
My guess is that the reload(syntax) causes that issubcluss/isinstance(foo, UDM_Objects) causes to return False as the original instance doesn't exists anymore.
Comment 5 Florian Best univentionstaff 2016-05-11 12:33:19 CEST
(In reply to Florian Best from comment #4)
wrong bug...
Comment 6 Florian Best univentionstaff 2017-01-10 12:16:12 CET
Affected syntax classes are:

import univention.admin.syntax
import inspect
slow = inspect.getmembers(univention.admin.syntax, lambda member: getattr(member, 'use_objects', False))
names = [x[1].name for x in slow]
print '\n'.join(names)

HostDN
IComputer_FQDN
LDAP_Server
MailHomeServer
PrinterNames
PrinterProducerList
Printers
Service
ServiceMail
ServicePrint
ServicePrint_FQDN
UCSSchool_Server_DN
UDM_Objects
UMC_OperationSet
UserMailAddress
Windows_Server
dhcpService
nagiosHostsEnabledDn
nagiosServiceDn
network
samlserviceprovider
uccImage
uccSessions
Comment 7 Florian Best univentionstaff 2017-01-10 12:19:17 CET
git grep -E 'syntax.\<(HostDN|IComputer_FQDN|LDAP_Server|MailHomeServer|PrinterNames|PrinterProducerList|Printers|Service|ServiceMail|ServicePrint|ServicePrint_FQDN|UCSSchool_Server_DN|UDM_Objects|UMC_OperationSet|UserMailAddress|Wind
ows_Server|dhcpService|nagiosHostsEnabledDn|nagiosServiceDn|network|samlserviceprovider|uccImage|uccSessions)\>' $(find -name '*.py')
Comment 8 Stefan Gohmann univentionstaff 2017-04-20 10:56:40 CEST
Sönke, is it still relevant for the customer? If so, can you explain which lookup is too slow so that we can focus on the relevant syntax.
Comment 9 Florian Best univentionstaff 2017-06-28 14:52:57 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 10 Stefan Gohmann univentionstaff 2019-01-03 07:23:15 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 11 Christina Scheinig univentionstaff 2020-08-20 09:07:43 CEST
This happend again in a school customer environment. The customer installed kopano for testing, but decided not to use it, so he deinstalled the app. After that, it takes more than 30 seconds to open one user. There is a proxy/loadbalancer which "cuts" the request after the 30 seconds. Without that the request taken 40 seconds.
So for the customer there are some few possibilities.
* He can adjust his proxy (for him better to less than 30 seconds, so he does not need to wait so long)
* He can remove all kopano attributes from his over 2000 users and remove kopano completely
* Or we can fix this issue.
Comment 12 Erik Damrose univentionstaff 2020-08-20 13:09:06 CEST
Did you try Florians suggestion and removed the Kopano extended attribute that uses the problematic LDAP_Search syntax?
Comment 13 Christina Scheinig univentionstaff 2020-08-20 14:09:23 CEST
(In reply to Erik Damrose from comment #12)
> Did you try Florians suggestion and removed the Kopano extended attribute
> that uses the problematic LDAP_Search syntax?

No, I don't know which one it is, and I also have no idea how to find out.
Comment 14 Florian Best univentionstaff 2020-08-20 14:14:25 CEST
(In reply to Christina Scheinig from comment #13)
> (In reply to Erik Damrose from comment #12)
> > Did you try Florians suggestion and removed the Kopano extended attribute
> > that uses the problematic LDAP_Search syntax?
> 
> No, I don't know which one it is, and I also have no idea how to find out.

udm settings/extended_attribute list | grep -C 20 LDAP_Search → search for kopano.
Let's not discuss this here.
Comment 15 Christina Scheinig univentionstaff 2020-08-21 09:11:49 CEST
(In reply to Florian Best from comment #14)
> (In reply to Christina Scheinig from comment #13)
> > (In reply to Erik Damrose from comment #12)
> > > Did you try Florians suggestion and removed the Kopano extended attribute
> > > that uses the problematic LDAP_Search syntax?
> > 
> > No, I don't know which one it is, and I also have no idea how to find out.
> 
> udm settings/extended_attribute list | grep -C 20 LDAP_Search → search for
> kopano.
> Let's not discuss this here.

Thank you for your help!

So, just for completion, we found the causing extended attribute, and removed it from the users/user module.

udm settings/extended_attribute modify --dn 'cn=SendAsPrivilege,cn=kopano,cn=custom attributes,cn=univention,dc=schein,dc=kop' --remove 'module=users/user'