LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 08-19-2016, 07:47 PM   #1
atelszewski
Member
 
Registered: Aug 2007
Distribution: Slackware
Posts: 948

Rep: Reputation: Disabled
libvirt (QEMU 2.6.0): virtfs (Plan 9, 9p) painfully slow, NFS on par with bare metal


Hi,

I'm trying to make use of 9p folder sharing under libvirt/QEMU.
Unfortunately, 9p seems to be painfully slow.

Below please find my test results. Before running the first pass of each test, I rebooted the physical PC to have the clean environment.

From the tests results, you can see that NFS read times (run from VM) are quite similar to those run directly on the hardware PC.
But when it comes to 9p, the times are 4 times bigger.
The size of the test ISO is 2.7G.

The PC is running Slackware 14.2 x86_86 (kernel 4.4.17).
The VM is running Slackware 14.2 x86_86 (kernel 4.4.14).
QEMU version is 2.6.0.
QEMU is run from qemu:///session, i.e. with regular user privileges.

On the VM, I mount the 9p in the following way:
Code:
qemu-hostfs                   /home/hostfs    9p   trans=virtio,version=9p2000.L,cache=mmap  0  0
I tried different cache= options, and indeed they speed up the thing.
Unfortunately, only after you have already read the data at least once.
And more importantly, syncing with host machine is not present, i.e. changing file contents on the host is not seen on the guest (it works fine with NFS).

The speed is important for me, because I'm running an interactive program from within the VM and the program has to read quite an amount of data. With 9p it's just too slow, with NFS it's just fine.

Do you have any ideas on what might be wrong with my setup, or is that just the way it is?
Thanks in advance!

BARE METAL:
First run (after reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
7.78user 0.92system 0:08.71elapsed 99%CPU (0avgtext+0avgdata 7504maxresident)k
5635120inputs+0outputs (1major+133minor)pagefaults 0swaps
Second run (without reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
7.78user 0.55system 0:08.33elapsed 100%CPU (0avgtext+0avgdata 7216maxresident)k
0inputs+0outputs (0major+136minor)pagefaults 0swaps
VM NFS (TCP):
First run (after reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
8.52user 1.47system 0:10.25elapsed 97%CPU (0avgtext+0avgdata 9504maxresident)k
5635112inputs+0outputs (1major+347minor)pagefaults 0swaps
Second run (without reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
8.27user 1.40system 0:09.92elapsed 97%CPU (0avgtext+0avgdata 10064maxresident)k
5635048inputs+0outputs (1major+348minor)pagefaults 0swaps
VM NFS (UDP):
First run (after reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
7.95user 1.57system 0:10.61elapsed 89%CPU (0avgtext+0avgdata 6640maxresident)k
5635112inputs+0outputs (1major+93minor)pagefaults 0swaps
Second run (without reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
7.88user 1.53system 0:10.34elapsed 91%CPU (0avgtext+0avgdata 6640maxresident)k
5635048inputs+0outputs (1major+92minor)pagefaults 0swaps
VM VIRTFS (PLAN 9):
First run (after reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
8.37user 6.36system 0:47.76elapsed 30%CPU (0avgtext+0avgdata 6640maxresident)k
88inputs+0outputs (1major+91minor)pagefaults 0swaps
Second run (without reboot):
Code:
$ /usr/bin/time md5sum slackware64-14.2-install-dvd.iso
a3108044508b1b7125e359b63e611761  slackware64-14.2-install-dvd.iso
7.81user 6.69system 0:46.69elapsed 31%CPU (0avgtext+0avgdata 6720maxresident)k
0inputs+0outputs (0major+91minor)pagefaults 0swaps
--
Best regards,
Andrzej Telszewski

Last edited by atelszewski; 08-19-2016 at 08:53 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: qemu's VirtFS host folder sharing in PV-domU (Xen Linux system 4.6) ? freddyk Linux - Virtualization and Cloud 0 08-20-2016 11:45 AM
Bare metal installation, remote martinlangley Linux - Server 1 09-11-2014 01:38 PM
Bare metal restore for RHEL 5.1 thespaceman Red Hat 4 10-21-2011 01:42 PM
rsync painfully slow over an nfs mount, between 2 vpn'ed pcs nass Slackware 2 09-21-2007 12:40 PM
Can I do a Bare Metal Restore? bob151 Linux - Software 1 04-14-2005 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration