A question about virtio inside qemu
Hi community,
I have a quick question about the virtio inside qemu. When the user application sends to a specific virtual disk a large number of read requests in a very short time, where should these requests be queued? Inside the virtqueue? virtqueue available ring or the underlying bdrv_read_aio()?
Currently, I run one guest vm with two virtual disks (one for ubuntu system, the other is to serve the data access.) When the system is running, I can check there are for instance 50 inflight requests to read or write the system virtual disk. However, the inflight requests to the data virtual disk is always one. Which is not reasonable, because inside the vm we calculated the avery response time for each request is much larger than the time interval between two adjacent requests.
My ultimate goal is to get the number of in-flight requests for a certain virtual disk. Could someone give me some hints?
Thanks a lot! I appreciate your help!
Yaodong
Quoted 1 line · Yaodong Yang
I have a quick question about the virtio inside qemu. When the user application sends to a specific virtual disk a large number of read requests in a very short time, where should these requests be queued? Inside the virtqueue? virtqueue available ring or the underlying
bdrv_read_aio()?
Requests take up descriptor space in the vring. Remember the vring consists of 3 things:
1. Descriptor space
2. Available ring
3. Used ring
While the request is pending its vring descriptors will be in use, regardless of whether the head index is in the avail/used rings.
Quoted 1 line
Currently, I run one guest vm with two virtual disks (one for ubuntu system, the other is to serve the data access.) When the system is running, I can check there are for instance 50 inflight requests to read or write the system virtual disk. However, the inflight requests to the data virtual disk is always one. Which is not reasonable, because inside the vm we calculated the avery response time for each request is much larger than the time interval between two adjacent requests.
I don't understand this paragraph. But virtio-blk and virtio-scsi support multiple in-flight requests. The guest should be able to achieve queue depths of around 128 with virtio-blk.
Quoted 1 line
My ultimate goal is to get the number of in-flight requests for a certain virtual disk. Could someone give me some hints?
Tools like iostat(1) can tell you about in-flight requests at the Linux block layer level.
Stefan