Bug 2224505

Summary: Paged search impacts performance [8.9.0]
Product: Red Hat Enterprise Linux 8 Reporter: Viktor Ashirov <vashirov>
Component: 389-ds-baseAssignee: Pierre Rogier <progier>
Status: CLOSED ERRATA QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 8.9CC: bsmejkal, emartyny, idm-ds-dev-bugs, idm-ds-qe-bugs, jonmoore, mreynolds, mrhodes, pasik, progier, tbordaz, tmihinto, vashirov
Target Milestone: rcKeywords: Reopened, Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: 389-ds-1.4-820230816162424-17499975 Doc Type: Bug Fix
Doc Text:
.Paged searches from a regular user now do not impact performance Previously, when Directory Server was under the search load, paged searches from a regular user could impact the server performance because a lock conflicted with the thread that polls for network events. In addition, if a network issue occurred while sending the page search, the whole server was unresponsive until the `nsslapd-iotimeout` parameter expired. With this update, the lock was split into several parts to avoid the contention with the network events. As a result, no performance impact during paged searches from a regular user.
Story Points: ---
Clone Of: 1974242
: 2232420 2247082 (view as bug list) Environment:
Last Closed: 2023-11-14 15:32:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1974242, 2224507, 2251374, 2265544    
Bug Blocks: 2232420, 2247082    

Comment 6 Viktor Ashirov 2023-08-21 13:56:48 UTC
Build tested: 389-ds-base-1.4.3.37-1.module+el8.9.0+19689+7d653af8.x86_64

I still see a big drop in performance:

Baseline:
ldclt -D "uid=test,ou=people,dc=example,dc=com" -w password -e bindeach,esearch -b "ou=people,dc=example,dc=com" -f "uid=user00001" 
ldclt[9084]: Average rate: 2630.00/thr  (2630.00/sec), total:  26300
ldclt[9084]: Average rate: 2642.40/thr  (2642.40/sec), total:  26424
ldclt[9084]: Average rate: 2593.20/thr  (2593.20/sec), total:  25932
ldclt[9084]: Average rate: 2649.50/thr  (2649.50/sec), total:  26495
ldclt[9084]: Average rate: 2138.70/thr  (2138.70/sec), total:  21387

PR search started in parallel to ldclt.
A normal user:
while : ; do ldapsearch -D "uid=test,ou=people,dc=example,dc=com" -w password -b dc=example,dc=com 'uid=*' -E pr=100/noprompt > /dev/null; done
ldclt[9084]: Average rate: 1062.90/thr  (1062.90/sec), total:  10629
ldclt[9084]: Average rate: 1049.20/thr  (1049.20/sec), total:  10492
ldclt[9084]: Average rate: 1015.80/thr  (1015.80/sec), total:  10158
ldclt[9084]: Average rate: 1048.50/thr  (1048.50/sec), total:  10485
ldclt[9084]: Average rate: 1046.00/thr  (1046.00/sec), total:  10460

Directory Manager:
while : ; do ldapsearch -D "cn=Directory Manager" -w password -b dc=example,dc=com 'uid=*' -E pr=100/noprompt > /dev/null; done
ldclt[9084]: Average rate:  617.10/thr  ( 617.10/sec), total:   6171
ldclt[9084]: Average rate:  604.30/thr  ( 604.30/sec), total:   6043
ldclt[9084]: Average rate:  590.60/thr  ( 590.60/sec), total:   5906
ldclt[9084]: Average rate:  587.90/thr  ( 587.90/sec), total:   5879

Anonymous user:
while : ; do ldapsearch -x -b dc=example,dc=com 'uid=*' -E pr=100/noprompt > /dev/null; done
ldclt[9084]: Average rate: 1070.60/thr  (1070.60/sec), total:  10706
ldclt[9084]: Average rate: 1062.00/thr  (1062.00/sec), total:  10620
ldclt[9084]: Average rate: 1095.40/thr  (1095.40/sec), total:  10954
ldclt[9084]: Average rate: 1089.10/thr  (1089.10/sec), total:  10891


Moving to ASSIGNED.

Comment 8 Viktor Ashirov 2023-08-24 10:54:21 UTC
Comparing with the older version I see an improvement:

Baseline
ldclt -D "uid=test,ou=people,dc=example,dc=com" -w password -e bindeach,esearch -b "ou=people,dc=example,dc=com" -f "uid=user00001"
389-ds-base-1.4.3.36-2.module+el8.9.0+19332+3ffa8e10.x86_64
ldclt[8796]: Average rate: 2749.50/thr  (2749.50/sec), total:  27495
ldclt[8796]: Average rate: 2921.00/thr  (2921.00/sec), total:  29210
ldclt[8796]: Average rate: 2807.20/thr  (2807.20/sec), total:  28072
ldclt[8796]: Average rate: 2817.80/thr  (2817.80/sec), total:  28178
ldclt[8796]: Average rate: 2691.10/thr  (2691.10/sec), total:  26911

389-ds-base-1.4.3.37-1.module+el8.9.0+19689+7d653af8.x86_64
ldclt[13571]: Average rate: 2876.00/thr  (2876.00/sec), total:  28760
ldclt[13571]: Average rate: 2844.70/thr  (2844.70/sec), total:  28447
ldclt[13571]: Average rate: 2920.80/thr  (2920.80/sec), total:  29208
ldclt[13571]: Average rate: 2898.90/thr  (2898.90/sec), total:  28989
ldclt[13571]: Average rate: 2828.80/thr  (2828.80/sec), total:  28288

PR search started in parallel to ldclt.
A normal user:
while : ; do ldapsearch -D "uid=test,ou=people,dc=example,dc=com" -w password -b dc=example,dc=com 'uid=*' -E pr=100/noprompt > /dev/null; done
389-ds-base-1.4.3.36-2.module+el8.9.0+19332+3ffa8e10.x86_64
ldclt[8796]: Average rate:  586.60/thr  ( 586.60/sec), total:   5866
ldclt[8796]: Average rate:  626.20/thr  ( 626.20/sec), total:   6262
ldclt[8796]: Average rate:  610.50/thr  ( 610.50/sec), total:   6105
ldclt[8796]: Average rate:  563.30/thr  ( 563.30/sec), total:   5633

389-ds-base-1.4.3.37-1.module+el8.9.0+19689+7d653af8.x86_64
ldclt[13571]: Average rate:  726.00/thr  ( 726.00/sec), total:   7260
ldclt[13571]: Average rate:  733.90/thr  ( 733.90/sec), total:   7339
ldclt[13571]: Average rate:  741.00/thr  ( 741.00/sec), total:   7410
ldclt[13571]: Average rate:  717.90/thr  ( 717.90/sec), total:   7179

Directory Manager:
while : ; do ldapsearch -D "cn=Directory Manager" -w password -b dc=example,dc=com 'uid=*' -E pr=100/noprompt > /dev/null; done
389-ds-base-1.4.3.36-2.module+el8.9.0+19332+3ffa8e10.x86_64
ldclt[8796]: Average rate:  191.30/thr  ( 191.30/sec), total:   1913
ldclt[8796]: Average rate:  206.70/thr  ( 206.70/sec), total:   2067
ldclt[8796]: Average rate:  193.10/thr  ( 193.10/sec), total:   1931
ldclt[8796]: Average rate:  204.40/thr  ( 204.40/sec), total:   2044
ldclt[8796]: Average rate:  201.70/thr  ( 201.70/sec), total:   2017

389-ds-base-1.4.3.37-1.module+el8.9.0+19689+7d653af8.x86_64
ldclt[13571]: Average rate:  680.20/thr  ( 680.20/sec), total:   6802
ldclt[13571]: Average rate:  627.90/thr  ( 627.90/sec), total:   6279
ldclt[13571]: Average rate:  607.20/thr  ( 607.20/sec), total:   6072
ldclt[13571]: Average rate:  589.10/thr  ( 589.10/sec), total:   5891
ldclt[13571]: Average rate:  586.80/thr  ( 586.80/sec), total:   5868


Marking as VERIFIED.

Comment 17 errata-xmlrpc 2023-11-14 15:32:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (389-ds:1.4 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6965