On Fri, Feb 16, 2018 at 12:54 PM, Howard Chu hyc@symas.com wrote:
Depends entirely on whether or not your libc supports crypt_r() (reentrant crypt). If not then yes, it has to be single-threaded because crypt() is not reentrant, it returns a pointer to static storage.
And of course, even if you use crypt_r() it's always possible that the underlying cipher is itself single-threaded. We have no way to know and no control over that.
Thanks Chu for the followup, I made the mistake of looking at the master source code which includes crypt_r support rather than the source code for 2.4.44 which we are presently running. It appears you added support for crypt_r on Sep 6, 2017 with commit afa861bf22, however that commit does not appear in any tagged version, `git tag --contains afa861bf22`
Do you have any idea when a version with this commit might be released?
I compiled master with crypt_r support and the results are much better
$ pidstat -t -p $(pgrep slapd) 5 3 <snip> Average: UID TGID TID %usr %system %guest %CPU CPU Command Average: 108 15720 - 788.67 0.07 0.00 788.73 - slapd Average: 108 - 15720 0.00 0.00 0.00 0.00 - |__slapd Average: 108 - 15721 0.00 0.00 0.00 0.00 - |__slapd Average: 108 - 15722 98.40 0.00 0.00 98.40 - |__slapd Average: 108 - 19581 38.80 0.00 0.00 38.80 - |__slapd Average: 108 - 19585 94.40 0.00 0.00 94.40 - |__slapd Average: 108 - 19591 94.00 0.00 0.00 94.00 - |__slapd Average: 108 - 19592 65.27 0.00 0.00 65.27 - |__slapd Average: 108 - 19650 98.80 0.00 0.00 98.80 - |__slapd Average: 108 - 19754 97.93 0.00 0.00 97.93 - |__slapd Average: 108 - 2526 39.00 0.00 0.00 39.00 - |__slapd Average: 108 - 3293 98.67 0.00 0.00 98.67 - |__slapd Average: 108 - 4694 63.60 0.00 0.00 63.60 - |__slapd