Bug 40240 - Performance optimization for App Center: UCR
Performance optimization for App Center: UCR
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-0-errata
Assigned To: Dirk Wiesenthal
Florian Best
:
Depends on:
Blocks: 38545
  Show dependency treegraph
 
Reported: 2015-12-14 00:06 CET by Dirk Wiesenthal
Modified: 2016-02-04 14:10 CET (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
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 2015-12-14 00:06:24 CET
One way might be caching of UCR. Currently, UCR is initialized in a lot of local functions. This way one does not have to think about thread safety, concurrent processes and so on. But it may cost too much time.

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

Startup performance for the UMC module is mediocre. We should elaborate ways to enhance execution speed.

One way might be caching of UCR. Currently, UCR is initialized in a lot of local functions. This way one does not have to think about thread safety, concurrent processes and so on. But it may cost too much time.

LDAP lookups may also be reduced, although this has already seen one patch.
Comment 1 Dirk Wiesenthal univentionstaff 2015-12-14 00:26:06 CET
Fixed in
  univention-appcenter 5.0.19-28.86.201512140023
Comment 2 Alexander Kläser univentionstaff 2015-12-15 11:21:03 CET
(In reply to Dirk Wiesenthal from comment #0)
> One way might be caching of UCR. Currently, UCR is initialized in a lot of
> local functions. This way one does not have to think about thread safety,
> concurrent processes and so on. But it may cost too much time.

Do you have any indications that UCR variable loading is a bottle neck w.r.t. performance?
Comment 3 Dirk Wiesenthal univentionstaff 2015-12-16 01:00:18 CET
Before patch:

time umc-command appcenter/query -U Administrator -P univention
real	0m10.883s
user	0m0.280s
sys	0m0.036s

After patch: (no pickle files yet)

time umc-command appcenter/query -U Administrator -P univention
real	0m5.629s
user	0m0.272s
sys	0m0.036s
Comment 4 Florian Best univentionstaff 2015-12-23 15:08:12 CET
ucr is still a argument of get_app_ldap_object():
python/appcenter/udm.py:def get_app_ldap_object(app, lo=None, pos=None, ucr=None, or_create=False):
Comment 5 Dirk Wiesenthal univentionstaff 2016-01-05 01:43:26 CET
Yes, left it there for backwards compatibility, but I guess this is silly (as I changed ApplicationLDAPObject, too).

univention-appcenter 5.0.19-38.95.201601050043
Comment 6 Florian Best univentionstaff 2016-01-11 15:49:23 CET
OK
Comment 7 Janek Walkenhorst univentionstaff 2016-02-04 14:10:10 CET
<http://errata.software-univention.de/ucs/4.1/79.html>