@@ -91,6 +91,50 @@ The `io_engine` field selects the host-side IO backend:
9191
9292See [ block-io-engine.md] ( api_requests/block-io-engine.md ) for more information.
9393
94+ ### Threaded Mode and Multiqueue
95+
96+ By default, Firecracker processes block requests on the VMM thread and exposes
97+ one queue for each drive. Set ` threaded ` to ` true ` to process each queue on a
98+ dedicated host worker thread. Threaded mode supports both the ` Sync ` and ` Async `
99+ IO engines. This moves block processing off the VMM thread. Multiple queues let
100+ Firecracker process requests from separate queues in parallel.
101+
102+ The ` num_queues ` field sets the number of queues that Firecracker exposes to the
103+ guest. Its default value is ` 1 ` . A value greater than ` 1 ` enables virtio-blk
104+ multiqueue and requires ` threaded ` to be ` true ` . The queue count cannot exceed
105+ the configured vCPU count. Firecracker also rejects a machine configuration
106+ update that would reduce the vCPU count below an existing drive's queue count.
107+
108+ Firecracker creates one worker thread for each configured queue, including
109+ queues that the guest does not use. All queues share the drive's rate limiter,
110+ so its limits apply to the total traffic for the drive.
111+
112+ Each worker thread is named ` fc_q<index>_<drive_id> ` , for example ` fc_q0_data ` .
113+ Linux limits thread names to 15 bytes, so longer names are truncated in tools
114+ that read the kernel thread name (` top ` , ` ps ` , ` perf ` , ...). The queue index
115+ comes first so truncation applies to the end of the ` drive_id ` . Drives whose
116+ ` drive_id ` share a long prefix might still collide. Firecracker logs keep the
117+ full name. To keep names distinct across drives, use a ` drive_id ` of at most 9
118+ bytes when using up to 10 queues, and at most 8 bytes for more than 10 queues.
119+
120+ The following configuration creates a drive with 4 queues and 4 worker threads:
121+
122+ ``` json
123+ {
124+ "drive_id" : " data" ,
125+ "path_on_host" : " ./data.ext4" ,
126+ "is_root_device" : false ,
127+ "is_read_only" : false ,
128+ "threaded" : true ,
129+ "num_queues" : 4
130+ }
131+ ```
132+
133+ The microVM must have at least 4 vCPUs before Firecracker accepts this drive. If
134+ a custom seccomp filter is used, it must include the ` blk_worker ` thread
135+ category described in the
136+ [ seccompiler documentation] ( seccompiler.md#json-file-format ) .
137+
94138### Read-only Devices
95139
96140Setting ` is_read_only ` to ` true ` causes Firecracker to open the backing file
0 commit comments