Configuring I/O thread polling parameters

The I/O thread polling behaviour can be tuned by using the poll-weight parameter . This parameter controls how recent I/O activity influences polling intervals to balance CPU efficiency and I/O performance.

Procedure

  • The poll-weight parameter can be adjusted within the range of 0-63, where weight="0" uses the default value of 3. Lower values increase the weight of recent I/O activity which results in faster adaptations. Higher values reduce the weight of recent I/O activities which results in less reactive adaptations. The default value 3 provides the best balance between CPU efficiency and I/O performance.
  • To adjust the weight parameter, specify the poll-weight in the range 0-63.

Example

Specify the poll-weight parameter in the domain configuration-XML file:
<domain type="kvm">
    ...
    <iothread id="1">
           <poll max="32768" grow="2" shrink="2" weight="3"/>
    </iothread>
    ...
</domain>
Adjust the I/O thread polling parameter for a running domain (specified with the <name> attribute) by issuing the libvirt command virsh iothreadset:
# virsh iothreadset <name> 1 --poll-weight 2 --live
To display the current I/O thread configuration, issue:
# virsh domstats <name> --iothread
Domain: <name>
   iothread.count=1
   iothread.1.poll-max-ns=32768
   iothread.1.poll-grow=2
   iothread.1.poll-shrink=2
   iothread.1.poll-weight=2