Overview#NDS Thread Pool is the Pool of NDS Threads
eDirectory is multi-threaded for performance reasons. In multi-threading, when the system is busy, more threads are created to handle the load and some threads are terminated to avoid extra overhead. As it is inefficient and costly to frequently create and destroy NDS Threads. Instead of spawning new threads and destroying them for every task, a number of threads are started and placed in the NDS Thread Pool pool. The system allocates the threads from the NDS Thread Pool to several tasks as needed. Tasks are held in two types of queues:
- Tasks that need immediate scheduling are held in the Ready queue.
- Tasks that need scheduling at a later time are held in the Waiting queue.
NDS Thread Pool NDSD Loadable Modules#Not every NDSD Loadable Module uses the NDS Thread Pool. The actual number of threads for the Processes is more than the number that exists in the NDS Thread Pool.
- FLAIM manages its background threads separately.
- imonitor number of threads are controlled by Http.server.threads-per-processor
NDS Thread Pool Monitoring#Run the ndsconfig get and ndsconfig set commands to get and set the NDS Thread Pool size parameters.
NDS Thread Pool size parameters are:
Running the ndstrace -c threads command returns the following thread pool statistics:
- The total number of threads that are spawned, terminated, and Idle threads.
- The total number of worker threads currently and the peak number of worker threads.
- The number of Ready tasks and the peak number of Ready task in the Ready queue.
- The minimum, maximum and average number of microseconds Ready tasks spent in the Ready queue.
- The current and maximum number of Ready tasks in the Waiting queue.
NDS Thread Pool Some Hints#eDirectory requires a minimum of 16 NDS Threads for its internal operations.
- one Monitor thread for every 255 LDAP client (DUA) connections.
- one Worker thread for every four concurrent DClients that need to be serviced. (Remember, NcpServers are DClients)
- eight NDS Threads for every Central Processing Unit (CPU) on the device to service client search requests.