Bug 31257 - "ucr get" vs "ucr shell" performance
"ucr get" vs "ucr shell" performance
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Philipp Hahn
:
: 33521 (view as bug list)
Depends on:
Blocks: 54237
  Show dependency treegraph
 
Reported: 2013-05-02 10:16 CEST by Stefan Gohmann
Modified: 2021-12-15 07:20 CET (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
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): Cleanup, Large environments, UCS Performance
Max CVSS v3 score:
best: Patch_Available+


Attachments
Regular expression optimization (1.18 KB, patch)
2013-05-24 11:25 CEST, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2013-05-02 10:16:05 CEST
"ucr shell var" needs a lot of more time than "ucr get var". It seems that "ucr shell var" builds all variables in the first step and filters the requested variable in a second step:

root@master501:~# time ucr get ldap/hostdn
cn=master501,cn=dc,cn=computers,dc=deadlock50,dc=local

real    0m0.053s
user    0m0.032s
sys     0m0.012s
root@master501:~# time ucr shell ldap/hostdn
ldap_hostdn=cn=master501,cn=dc,cn=computers,dc=deadlock50,dc=local

real    0m0.265s
user    0m0.240s
sys     0m0.016s
root@master501:~# time ucr shell 
apache2_allowoverride=''
[...]

real    0m0.294s
user    0m0.236s
sys     0m0.024s
root@master501:~# 

See also Bug #31256
Comment 1 Philipp Hahn univentionstaff 2013-05-24 11:25:07 CEST
Created attachment 5237 [details]
Regular expression optimization

The problem is that "ucr search" expects a *list of regular expressions*, while "ucr get" expects a *single variable name for an exact match*.

# time ucr shell $(ucr search --brief | cut -d: -f1) >/dev/null
real    0m0.733s
# time ucr shell >/dev/null
real    0m0.218s
# time ucr dump >/dev/null
real    0m0.081s

Instead of compiling all regular expressions for themselves, the attached patch combines all arguments to one giant regexp and used that:

# time ucr shell $(ucr search --brief | cut -d: -f1) >/dev/null
real    0m0.592s
# time ucr shell >/dev/null
real    0m0.221s

This is only slightly better than the original implementation.
Comment 2 Florian Best univentionstaff 2017-02-10 10:24:32 CET
*** Bug 33521 has been marked as a duplicate of this bug. ***
Comment 3 Ingo Steuwer univentionstaff 2020-07-03 20:54:04 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.
Comment 4 Florian Best univentionstaff 2020-07-14 12:26:34 CEST
univention-config-registry (15.0.0-6)
 Bug #31257: improove UCR shell performance

changelog-5.0-0.xml
 Changelog Bug #31257
Comment 5 Philipp Hahn univentionstaff 2020-07-20 08:37:01 CEST
OK: c943a56003e83fdab0173ff77698b1c518786498
FIXED: 099c91e7edc3e6cea266cf1333a1c26ae7482d71
OK: ucr search
OK: ucr search a b c d e f g h i j k l m n o p q r s t u v w x y z ''
FIXED: b8de8f71ba3a82c4a959317edde351056196d936
Comment 6 Florian Best univentionstaff 2021-05-25 16:01:58 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".