2.2 KiB
threads
There are multiple thread pools used in mergerfs to provide parallel behaviors.
read-thread-count
Defaults to 0
The number of threads used to read (and possibly process) messages from the kernel.
read-thread-count=N
whereN>0
: Create a thread pool ofN
threads.read-thread-count=N
whereN<0
: Create a thread pool ofCPUCount / -N
threads.read-thread-count=0
andprocess-thread-count!=-1
: Creates2
read threads and number of process threads as defined below.read-thread-count=0
andprocess-thread-count=-1
: Creates2
read threads and upto8
process threads depending on the CPU core count.
When process-thread-count=-1
(the default) this option sets the
number of threads which read and then process requests from the
kernel.
When process-thread-count
is set to anything else mergerfs will
create two thread pools. A "read" thread pool which just reads from
the kernel and hands off requests to the "process" thread pool.
Generally, only 1 or 2 "read" threads are necessary when used with a process thread pool.
process-thread-count
Defaults to -1
When enabled this sets the number of threads in the message processing pool.
process-thread-count=-1
: Process thread pool is disabled.process-thread-count=0
: Create a thread pool upto8
process threads depending on the CPU core count.process-thread-count=N
whereN>0
: Create a thread pool ofN
threads.process-thread-count=N
whereN<-1
: Create a thread pool ofCPUCount / -N
threads.
process-thread-queue-depth
- Defaults to
3
Sets the depth queue for the processing thread queue per thread. Meaning if the read threads are getting requests faster than can be processed they will be queued up upto the queue depth. Despite the calculation being per thread the queue depth however is shared across all in the pool.
process-thread-queue-depth=N
whereN>0
: Sets the number of outstanding requests that the process thread pool can have toN * process-thread-count
. If requests come in faster than can be processed and the max queue depth hit then queuing the request will block in order to limit memory growth.process-thread-queue-depth<=0
: Sets the queue depth to 3.