{"id":3458,"date":"2023-03-31T17:58:49","date_gmt":"2023-03-31T16:58:49","guid":{"rendered":"https:\/\/kudzia.eu\/b\/?p=3458"},"modified":"2023-03-31T17:59:07","modified_gmt":"2023-03-31T16:59:07","slug":"temporarily-speeding-up-io-performance-for-kvm-vm","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2023\/03\/temporarily-speeding-up-io-performance-for-kvm-vm\/","title":{"rendered":"temporarily speeding up IO performance for KVM VM"},"content":{"rendered":"\n<p>i have few VMs running on top of spinning rust. recently i&#8217;ve upgraded one of them to not-yet-stable debian bookworm. upgrade would be pretty slow but.. i&#8217;ve edited the VM definition and asked KVM to allow host server to cache any IO operations. speedup was great, bullseye->bookworm upgrade finished in less than 5 minutes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># stop the VM\n# on the KVM host\nvirsh edit nameOfVM\n# search for virtual disk definition and add\n# cache='unsafe' as below:\n&lt;disk type='file' device='disk'>\r\n  &lt;driver name='qemu' type='qcow2'         cache='unsafe'        \/>\r\n  &lt;source file='\/mnt\/vms\/nameOfVM\/vda.qcow2'\/>\r\n  &lt;target dev='vda' bus='virtio'\/>\r\n  &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'\/>\r\n&lt;\/disk>\nvirsh define \/etc\/libvirt\/qemu\/nameOfVM.xml\nvirsh start nameOfVM\n\n# after the upgrade repeat above and remove cache='unsafe'\n<\/code><\/pre>\n\n\n\n<p>for more details &#8211; see <a href=\"https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/7\/html\/virtualization_tuning_and_optimization_guide\/sect-virtualization_tuning_optimization_guide-blockio-caching\">Red Hat&#8217;s documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i have few VMs running on top of spinning rust. recently i&#8217;ve upgraded one of them to not-yet-stable debian bookworm. upgrade would be pretty slow but.. i&#8217;ve edited the VM definition and asked KVM to allow host server to cache any IO operations. speedup was great, bullseye->bookworm upgrade finished in less than 5 minutes. for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,51],"tags":[49],"class_list":["post-3458","post","type-post","status-publish","format-standard","hentry","category-tech","category-unimportant","tag-kvm"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=3458"}],"version-history":[{"count":1,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3458\/revisions"}],"predecessor-version":[{"id":3459,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/3458\/revisions\/3459"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=3458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=3458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=3458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}