How to allow nbd devices to submit io requests simultaneously more than physical cpu cores?

35 views Asked by At

Currently nbd protocol supports no multiplexing of request bodies. Hence inside a single socket, requests has to be written one after another. The only way to dispatch multiple requests in parallel, is to create more than one socket per nbd client (option ‐connections or -C).

Unfortunately (or I don't know how to configure), I am not able to achieve parallelism more than cpu cores available (nproc) even if I use a lot of sockets. Somehow both the blk-mq of nbd devices and total simultaneous request submission is upper bounded by the total cpu cores.

I tried changing the /sys/block/nbd*/queue/nr_requests value to more than 128, but it is not allowed. I believe nr_requests is the maximum number of in-flight requests (submitted but not yet replied by server).

e.g. When I have 8 core cpu, (nproc = 8) All of the following have similar latency results (not IOPS).

nbd-client -N default -t 120 -p -R -C 8  localhost 10809 /dev/nbd0
nbd-client -N default -t 120 -p -R -C 12  localhost 10809 /dev/nbd0
nbd-client -N default -t 120 -p -R -C 48  localhost 10809 /dev/nbd0

Hence I am limited to submit 8 requests in parallel at a time. Is there any way to overcome this limitation?

P.S.: This question has nothing to do with IOPS or throughput. The nbd servers capability of fulfilling responses decide that. This is specifically about low latency IO, when a storm of IO requests are coming, it is important for the requests to reach the server in lowest possible time.

0

There are 0 answers