Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
QEMU: Slow disk IO
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
therealjrd
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2006
Posts: 103

PostPosted: Thu Oct 20, 2016 12:28 am    Post subject: QEMU: Slow disk IO Reply with quote

Hi experts.

I know this topic has come up a bunch of times before. I've read numerous posts in this forum and other places about how to get decent disk performance running guests in qemu, but so far I haven't found the right combination.

A few factoids:

Host is a Dell 755 with an Intel Core Duo E6550 processor. Currently running a gentoo 4.1.2 kernel. I've enabled kvm and virtio drivers.

I've tried a number of guest configs, again with virtio enabled. At the moment my guest is running a stripped-down 4.1.12 kernel, no modules.

I've tried qcow and raw formats for the image files, both are slow; raw is slightly less slow.

On the qemu invocation, I specify the disk as -drive file=disk.raw,format=raw,cache=none,if=virtio. The device does show up in the guest as /dev/vda. I'm using io scheduler no-op on the guest.

Disk performance is still terrible. It takes hours for the guest to run through package dependencies when I emerge world. Compiling a big-ish package like gcc takes a couple of days.

I'm stumped. What else should I be looking at?

Thanks in advance.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2968
Location: Germany

PostPosted: Thu Oct 20, 2016 12:38 am    Post subject: Reply with quote

Create a block device with LVM. That way, you don't have to go through the filesystem layer of the OS, which adds a ton of overhead.

If the VM has enough RAM you could build stuff in a tmpfs. If that's still slow it has nothing to do with disk I/O as it happens in RAM.

Maybe you got a slow CPU. If in doubt, try -cpu host. Note that this will mess with the compiler settings if you are running with -march=native and the produced binaries will not work if you switch the host platform.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5640

PostPosted: Thu Oct 20, 2016 1:16 am    Post subject: Reply with quote

It might be faster to use 9p or NFS to the host.
Back to top
View user's profile Send private message
therealjrd
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2006
Posts: 103

PostPosted: Fri Oct 21, 2016 6:42 pm    Post subject: [SOLVED] QEMU: Slow disk IO Reply with quote

I'm an idiot.

I went back to square one and started checking config. I had somehow managed to turn off the virtualization flags in my host BIOS. I have no idea why it ran at all :)

Now my x86_64 vm is working great. The x86 one is still fairly slow, I'm pretty sure that's because I haven't found a good -cpu setting yet.

Thanks everyone for your ideas! Next time I'll do a more thorough background check before posting.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5640

PostPosted: Sat Oct 22, 2016 5:53 pm    Post subject: Re: [SOLVED] QEMU: Slow disk IO Reply with quote

therealjrd wrote:
Now my x86_64 vm is working great. The x86 one is still fairly slow, I'm pretty sure that's because I haven't found a good -cpu setting yet.

Use the same one for both? The only difference is the software.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum