Skip to content

Commit

Permalink
Issue 5551 - Almost empty and not loaded ns-slapd high cpu load
Browse files Browse the repository at this point in the history
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
  • Loading branch information
obaterspok authored and mreynolds389 committed Jun 29, 2023
1 parent b6cede5 commit f2c1e44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ldap/servers/slapd/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ slapd_daemon(daemon_ports_t *ports)
/* The meat of the operation is in a loop on a call to select */
while (!g_get_shutdown()) {

usleep(1000);
usleep(500 * 1000);
}
/* We get here when the server is shutting down */
/* Do what we have to do before death */
Expand Down

0 comments on commit f2c1e44

Please sign in to comment.