You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Issue Description
Code review show that c_mutex is held for a quite long period (in bind.c) while performing autobind:
When doing anonymous bind on a connection using SASL/EXTERNAL mechanism
the mutex is held during the whole lookup that maps the SSL certificate to the bind dn
but the page search issue showed that holding that c_mutex has a terrible impact on overall performance
Package Version and Platform:
Platform: Fedora, RHEL
Package and version: main branch
Browser [e.g. chrome, safari]
Steps to Reproduce
The steps are quite similar to the paged search result performance issue.
The trick is to enable the internal operation flags in access log and disable the standard operation, it makes the fact that the lock is held during autobind internal search very visible.
Setup an instance (named standalone1) and having suffix dc=example,dc=com with default tests entries generated by dscreate"
In another windows run a loop on: ldapsearch -Q -LLL -Y EXTERNAL -H ldapi://%2fvar%2frun%2fslapd-standalone1.socket -b dc=example,dc=com cn=demo
Then you should see the ldclt performance dropping significantly:
ldclt[416127]: Average rate: 14371.20/thr (14371.20/sec), total: 143712
ldclt[416127]: Average rate: 14527.00/thr (14527.00/sec), total: 145270
ldclt[416127]: Average rate: 8274.10/thr (8274.10/sec), total: 82741
ldclt[416127]: Average rate: 4551.20/thr (4551.20/sec), total: 45512
ldclt[416127]: Average rate: 4191.30/thr (4191.30/sec), total: 41913
Should not have a significant performance drop.
Additional context
I thought about several solutions:
computing the mapping out of the lock and only lock to get/data into the connection (but it only solve the autobind code)
split the lock between the data needed for accept and listen threads (but it impacts lots of places and so there are risks ... )
using try lock to acquire the lock in the listening thread and just skip the connection if the lock is busy.
That may leads to CPU load increase (because the listening thread loops until the mutex get released but
at least events on other connections are handled).
The text was updated successfully, but these errors were encountered:
Issue Description
Code review show that c_mutex is held for a quite long period (in bind.c) while performing autobind:
When doing anonymous bind on a connection using SASL/EXTERNAL mechanism
the mutex is held during the whole lookup that maps the SSL certificate to the bind dn
but the page search issue showed that holding that c_mutex has a terrible impact on overall performance
Package Version and Platform:
Steps to Reproduce
The steps are quite similar to the paged search result performance issue.
The trick is to enable the internal operation flags in access log and disable the standard operation, it makes the fact that the lock is held during autobind internal search very visible.
dsconf standalone1 config replace nsslapd-accesslog-level=4ldclt -p 389 -e esearch -b "dc=example,dc=com" -f "cn=demo"ldapsearch -Q -LLL -Y EXTERNAL -H ldapi://%2fvar%2frun%2fslapd-standalone1.socket -b dc=example,dc=com cn=demoShould not have a significant performance drop.
Additional context
I thought about several solutions:
That may leads to CPU load increase (because the listening thread loops until the mutex get released but
at least events on other connections are handled).
The text was updated successfully, but these errors were encountered: