-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Almost empty and not loaded ns-slapd high cpu load #5551
Comments
I think that core of issue is : 1000000 is 0.001 of seconds . Due to it nanosleep call executes 1000 times per second and eat host cpu power. In case if nanosleep used to wait for event better to implement it using poll instead or if nanosleep critically needed then to exit from nanosleep early than timer expired need to implement signal handler. Or may be it will be good to have also a crutch solution - adjustable nanosleep delay config setting. |
@jpVm5jYYRE1VIKL Can you pinpoint which call to clock_nanosleep is causing this? A stack trace or similar? That would really help. |
It's fixed by this: #5813 |
Description: This lowers the cpu usage on the ns-slapd process on a idle system from ~ 7% to 5% relates: 389ds#5551
@obaterspok - you didn't have to close the PR :-) We just wanted you to update the commit. Could file it again? Or are you still working on it? |
@mreynolds389 - I'm sorry, I took a shortcut with the PR as I just edited the code directly on github and I just couldn't figure out how I would squash it. Therefor I have cloned it now and will resend it shortly btw, do you want it as usleep(500 * 1000); or as DS_Sleep(PR_MillisecondsToInterval(500));? |
Hmm, it doesn't really matter. Well we don't use usleep anywhere else in the code, but for consistency I guess use the DS_Sleep() function. |
Bug Description: stracing the ns-slapd process one can see nanosleep gets called a lot as we only sleep for 1ms Fix Description: Increasing the sleep time from 1ms to 500ms and the cpu usage will drop drop a few percent and strace will be more usable relates: 389ds#5551 Reviewd by: @mreynolds389
I kept usleep as it was quite convenient due to nanosleep output in the strace instead of pselect. Hope it was okay |
Bug Description: stracing the ns-slapd process one can see nanosleep gets called a lot as we only sleep for 1ms Fix Description: Increasing the sleep time from 1ms to 500ms and the cpu usage will drop drop a few percent and strace will be more usable relates: #5551 Reviewd by: @mreynolds389
Bug Description: stracing the ns-slapd process one can see nanosleep gets called a lot as we only sleep for 1ms Fix Description: Increasing the sleep time from 1ms to 500ms and the cpu usage will drop drop a few percent and strace will be more usable relates: #5551 Reviewd by: @mreynolds389
Bug Description: stracing the ns-slapd process one can see nanosleep gets called a lot as we only sleep for 1ms Fix Description: Increasing the sleep time from 1ms to 500ms and the cpu usage will drop drop a few percent and strace will be more usable relates: #5551 Reviewd by: @mreynolds389
642760b..a9f687e 389-ds-base-2.3 -> 389-ds-base-2.3 Thanks for the contribution @obaterspok ! |
Sounds like a perfect reason to keep it, thanks! |
Issue Description
Almost empty and not loaded 389ds high cpu load.
Restart of container does not solve issue.
Logs does not contain any errors.
strace attached to ns-slapd show following :
Package Version and Platform:
Docker
Steps to Reproduce
Not clear.
The text was updated successfully, but these errors were encountered: