Bug 34003 - Committing slapd.conf is slow due to 25univention-ldap-server_local-schema
Committing slapd.conf is slow due to 25univention-ldap-server_local-schema
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 5.0
Other Linux
: P5 enhancement (vote)
: UCS 5.0
Assigned To: Florian Best
Julia Bremer
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-28 19:40 CET by Arvid Requate
Modified: 2021-05-25 15:59 CEST (History)
3 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, UCS Performance
Max CVSS v3 score:
requate: Patch_Available+


Attachments
25univention-ldap-server_local-schema (1.85 KB, text/plain)
2014-01-28 19:40 CET, Arvid Requate
Details
patch (3.05 KB, patch)
2020-06-22 17:44 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2014-01-28 19:40:11 CET
Created attachment 5758 [details]
25univention-ldap-server_local-schema

Committing slapd.conf is slow due to 25univention-ldap-server_local-schema. In my thests the attached version speeded this up by about a factor of four and it scales much better with the number of additional local schema files. Maybe the code got more ugly but this may be improved.
Comment 1 Florian Best univentionstaff 2017-04-24 16:22:35 CEST
It's still slow to commit /etc/ldap/slapd.conf.
Comment 2 Stefan Gohmann univentionstaff 2017-06-16 20:39:09 CEST
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4.

If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
Comment 3 Florian Best univentionstaff 2020-06-22 17:44:00 CEST
Created attachment 10403 [details]
patch
Comment 4 Florian Best univentionstaff 2020-06-22 17:45:02 CEST
Great performance improovement!
Use ucr_filter() instead of subprocess(['cat']) | subprocess(['ucr', 'filter']).
Comment 5 Florian Best univentionstaff 2020-10-01 20:07:30 CEST
Updated patch in git:fbest/34003-performance-of-25univention-ldap-server_local-schema
This increases commiting slapd.conf in 2 seconds instead of 18 seconds. The resulting content is equal.

Previous:
# time ucr commit /etc/ldap/slapd.conf
Multifile: /etc/ldap/slapd.conf

real    0m18,364s
user    0m15,608s
sys     0m2,909s
# time ucr commit /etc/ldap/slapd.conf
Multifile: /etc/ldap/slapd.conf

real    0m19,683s
user    0m16,578s
sys     0m3,297s
# time ucr commit /etc/ldap/slapd.conf
Multifile: /etc/ldap/slapd.conf

real    0m19,016s
user    0m16,090s
sys     0m3,137s

Afterwards:
# time ucr commit /etc/ldap/slapd.conf
Multifile: /etc/ldap/slapd.conf

real    0m1,982s
user    0m1,677s
sys     0m0,313s
# time ucr commit /etc/ldap/slapd.conf
Multifile: /etc/ldap/slapd.conf

real    0m2,073s
user    0m1,723s
sys     0m0,361s
# time ucr commit /etc/ldap/slapd.conf
Multifile: /etc/ldap/slapd.conf

real    0m2,099s
user    0m1,804s
sys     0m0,308s
Comment 7 Florian Best univentionstaff 2021-02-11 10:46:39 CET
Fixed: instead of 2 subprocesses per file run_filter() is invoked directly.

univention-ldap (16.0.6-1)
458dcdfb4a34 | Bug #34003: fix performance of 25univention-ldap-server_local-schema

changelog-5.0-0.xml
458dcdfb4a34 | Bug #34003: fix performance of 25univention-ldap-server_local-schema
Comment 8 Julia Bremer univentionstaff 2021-02-12 08:48:33 CET
This fixed Bug #52745.
Code review: OK
Resulting content of slapd.conf is the same: OK
Tests: OK
Tests that failed due to the long time it took to commit slapd.conf are green again: OK
Changelog: OK

Verified
Comment 9 Florian Best univentionstaff 2021-05-25 15:59:24 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".