All of lore.kernel.org
 help / color / mirror / Atom feed
* Poor network performance with cable modem assigned to guest
@ 2009-08-28 18:14 Jon Fairbairn
  2009-08-28 18:35 ` Brian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Fairbairn @ 2009-08-28 18:14 UTC (permalink / raw)
  To: kvm

I'm experimenting with a virtual router. I did this a few years ago with
Xen and it worked well enough, but then fedora changed and it stopped
working, so I gave up for a while. Now I have a machine that supports
hardware virtualisation, I thought I'd try again.

The setup was done through virt-manager. The network between the host
and guest is a virtual bridge. What I've been trying to do is to assign
a USB cable modem to the guest, and connect to the internet through
that. I'd expect some degradation in performance, especially since
there's a firewall on both the virtual router and on the host. Here's
some figures wgetting a 12802500 byte file thrice from a nearby web
server:

Via hardware router: 1009K/s 1008K/s 1010K/s (12 or 13s)
Cable modem on host:   1.00M/s 1.00M/s 1.00M/s    (ditto)

(wait for it)

Via virtual router, assigned usb: 21.1K/s   (9m 58s!)

Now, as I said, I expected some performance hit doing it this way, but a
factor of fifty takes the biscuit.

What can be wrong?

 * * *

Details:

"Cable modem on host" above just means that I attached the cable modem
to the host and configured it as a network device in the usual way.

From the host to the guest I get about 12MB/s using scp, from the guest
to the host (initiated from the host) I get 7MB/s.

The host is AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ with 6G of
RAM of which 256M is assigned to the guest (the hardware version only
has 188M) neither virtual nor hardware router has any swap.

The hardware router is the same kernel and nearly (modulo IP addresses
etc) the same configuration as the virtual router, running on an old ibm
pc (500MHz pentium III).

kernel on host: 2.6.29.6-217.2.16.fc11.x86_64
kernel on routers: 2.6.29.6-217.2.8.fc11.i586

All running fedora 11 (though the routers are very much cut down
installations).

qemu-kvm-0.10.6
libvirt-0.6.2-15.1.fc11.x86_64

libvirt uses this command to start the virtual machine:

LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc \
 -m 256 -smp 1 -name monogramme-virtual \
 -uuid [redacted] -monitor pty \
 -pidfile /var/run/libvirt/qemu//monogramme-virtual.pid \
 -boot d \
 -drive file=/[wherever]/livecd-fedora-monogramme.iso,\
if=ide,media=cdrom,index=2 \
 -net nic,macaddr=54:52:00:14:4f:18,vlan=0 \
 -net tap,fd=11,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 \
 -k en-gb \
 -usbdevice host:0bb2:6098 

0bb2:6098 = Ambit Microsystems Corp. USB Cable Modem (a usb 1.1 device)

Selinux is on on both machines.

I can't think of anything else relevant at the moment.

-- 
Jón Fairbairn                                 Jon.Fairbairn@cl.cam.ac.uk



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Poor network performance with cable modem assigned to guest
  2009-08-28 18:14 Poor network performance with cable modem assigned to guest Jon Fairbairn
@ 2009-08-28 18:35 ` Brian Jackson
  2009-08-29  9:24   ` Jon Fairbairn
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Jackson @ 2009-08-28 18:35 UTC (permalink / raw)
  To: Jon Fairbairn; +Cc: kvm

On Friday 28 August 2009 01:14:42 pm Jon Fairbairn wrote:
> I'm experimenting with a virtual router. I did this a few years ago with
> Xen and it worked well enough, but then fedora changed and it stopped
> working, so I gave up for a while. Now I have a machine that supports
> hardware virtualisation, I thought I'd try again.
>
> The setup was done through virt-manager. The network between the host
> and guest is a virtual bridge. What I've been trying to do is to assign
> a USB cable modem to the guest,


This is probably your problem here. KVM only emulates a usb1.1 controller, and 
from all reports, it doesn't really do that very well. There have been 
numerous reports of poor performance even for a usb1.1 device. You should 
check the archives to see if there was ever any kind of tips or resolution to 
some of those problems.


> and connect to the internet through
> that. I'd expect some degradation in performance, especially since
> there's a firewall on both the virtual router and on the host. Here's
> some figures wgetting a 12802500 byte file thrice from a nearby web
> server:
>
> Via hardware router: 1009K/s 1008K/s 1010K/s (12 or 13s)
> Cable modem on host:   1.00M/s 1.00M/s 1.00M/s    (ditto)
>
> (wait for it)
>
> Via virtual router, assigned usb: 21.1K/s   (9m 58s!)
>
> Now, as I said, I expected some performance hit doing it this way, but a
> factor of fifty takes the biscuit.
>
> What can be wrong?
>
>  * * *
>
> Details:
>
> "Cable modem on host" above just means that I attached the cable modem
> to the host and configured it as a network device in the usual way.
>
> From the host to the guest I get about 12MB/s using scp, from the guest
> to the host (initiated from the host) I get 7MB/s.
>
> The host is AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ with 6G of
> RAM of which 256M is assigned to the guest (the hardware version only
> has 188M) neither virtual nor hardware router has any swap.
>
> The hardware router is the same kernel and nearly (modulo IP addresses
> etc) the same configuration as the virtual router, running on an old ibm
> pc (500MHz pentium III).
>
> kernel on host: 2.6.29.6-217.2.16.fc11.x86_64
> kernel on routers: 2.6.29.6-217.2.8.fc11.i586
>
> All running fedora 11 (though the routers are very much cut down
> installations).
>
> qemu-kvm-0.10.6
> libvirt-0.6.2-15.1.fc11.x86_64
>
> libvirt uses this command to start the virtual machine:
>
> LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc \
>  -m 256 -smp 1 -name monogramme-virtual \
>  -uuid [redacted] -monitor pty \
>  -pidfile /var/run/libvirt/qemu//monogramme-virtual.pid \
>  -boot d \
>  -drive file=/[wherever]/livecd-fedora-monogramme.iso,\
> if=ide,media=cdrom,index=2 \
>  -net nic,macaddr=54:52:00:14:4f:18,vlan=0 \
>  -net tap,fd=11,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 \
>  -k en-gb \
>  -usbdevice host:0bb2:6098
>
> 0bb2:6098 = Ambit Microsystems Corp. USB Cable Modem (a usb 1.1 device)
>
> Selinux is on on both machines.
>
> I can't think of anything else relevant at the moment.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Poor network performance with cable modem assigned to guest
  2009-08-28 18:35 ` Brian Jackson
@ 2009-08-29  9:24   ` Jon Fairbairn
  2009-08-29 17:03     ` Jim Paris
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Fairbairn @ 2009-08-29  9:24 UTC (permalink / raw)
  To: kvm

Brian Jackson <iggy@theiggy.com> writes:

> On Friday 28 August 2009 01:14:42 pm Jon Fairbairn wrote:
>> I'm experimenting with a virtual router. I did this a few years ago with
>> Xen and it worked well enough, but then fedora changed and it stopped
>> working, so I gave up for a while. Now I have a machine that supports
>> hardware virtualisation, I thought I'd try again.
>>
>> The setup was done through virt-manager. The network between the host
>> and guest is a virtual bridge. What I've been trying to do is to assign
>> a USB cable modem to the guest,
>
>
> This is probably your problem here. KVM only emulates a usb1.1
> controller,

that shouldn't be a problem as the cable modem is only a usb 1.1 device.

> and from all reports, it doesn't really do that very well.

Not very well? We're talking about a factor of *FIFTY* slow down here.
If I'd implemented the driver in a 1980s lazy functional language I
would have only expected a factor of ten :-P ;-).

> There have been numerous reports of poor performance even for a usb1.1
> device. You should check the archives to see if there was ever any
> kind of tips or resolution to some of those problems.

I had a look, but I couldn't find anything helpful. Maybe I'm searching
for the wrong things?

-- 
Jón Fairbairn                                 Jon.Fairbairn@cl.cam.ac.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Poor network performance with cable modem assigned to guest
  2009-08-29  9:24   ` Jon Fairbairn
@ 2009-08-29 17:03     ` Jim Paris
  2009-09-12  7:51       ` Jon Fairbairn
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Paris @ 2009-08-29 17:03 UTC (permalink / raw)
  To: Jon Fairbairn; +Cc: kvm

Jon Fairbairn wrote:
> Brian Jackson <iggy@theiggy.com> writes:
> 
> > On Friday 28 August 2009 01:14:42 pm Jon Fairbairn wrote:
> >> I'm experimenting with a virtual router. I did this a few years ago with
> >> Xen and it worked well enough, but then fedora changed and it stopped
> >> working, so I gave up for a while. Now I have a machine that supports
> >> hardware virtualisation, I thought I'd try again.
> >>
> >> The setup was done through virt-manager. The network between the host
> >> and guest is a virtual bridge. What I've been trying to do is to assign
> >> a USB cable modem to the guest,
> >
> >
> > This is probably your problem here. KVM only emulates a usb1.1
> > controller,
> 
> that shouldn't be a problem as the cable modem is only a usb 1.1 device.
> 
> > and from all reports, it doesn't really do that very well.
> 
> Not very well? We're talking about a factor of *FIFTY* slow down here.
> If I'd implemented the driver in a 1980s lazy functional language I
> would have only expected a factor of ten :-P ;-).
> 
> > There have been numerous reports of poor performance even for a usb1.1
> > device. You should check the archives to see if there was ever any
> > kind of tips or resolution to some of those problems.
> 
> I had a look, but I couldn't find anything helpful. Maybe I'm searching
> for the wrong things?

I don't have any specific answers, but you might be able to get some
more info by uncomenting the "//#define DEBUG" in kvm's usb-linux.c.
You might also try capturing the USB traffic (e.g. with wireshark)
both in the host with the modem connected directly, and in the
guest with the modem passed through, to see if there are any
differences other than speed (packet sizes, etc).  Also try comparing
the "lsusb -vvv" output in both guest and host?

-jim

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Poor network performance with cable modem assigned to guest
  2009-08-29 17:03     ` Jim Paris
@ 2009-09-12  7:51       ` Jon Fairbairn
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Fairbairn @ 2009-09-12  7:51 UTC (permalink / raw)
  To: kvm

Jim Paris <jim@jtan.com> writes:

> Jon Fairbairn wrote:
>> Brian Jackson <iggy@theiggy.com> writes:
>> 
>> > On Friday 28 August 2009 01:14:42 pm Jon Fairbairn wrote:
>> >> The setup was done through virt-manager. The network between the host
>> >> and guest is a virtual bridge. What I've been trying to do is to assign
>> >> a USB cable modem to the guest,
>> >
>> >
>> > This is probably your problem here. KVM only emulates a usb1.1
>> > controller,
>> 
>> that shouldn't be a problem as the cable modem is only a usb 1.1 device.
>> 
>> > and from all reports, it doesn't really do that very well.
>> 
>> Not very well? We're talking about a factor of *FIFTY* slow down here.
>> If I'd implemented the driver in a 1980s lazy functional language I
>> would have only expected a factor of ten :-P ;-).

> I don't have any specific answers, but you might be able to get some
> more info by uncomenting the "//#define DEBUG" in kvm's usb-linux.c.
> You might also try capturing the USB traffic (e.g. with wireshark)

Thanks for your comments; I was waiting for a time when the network
wasn't in constant use to try some experiminents, but unfortunately my
ISP has replaced the cable modem with a newer version that doesn't have
a USB port, so I have to abandon this approach anyway.

[Assigning a physical PCI device to a kvm guest doesn't work with 
AMD Athlon(tm) 64 X2 Dual Core Processor 4400+
does it?]

-- 
Jón Fairbairn                                 Jon.Fairbairn@cl.cam.ac.uk


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-12  7:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-28 18:14 Poor network performance with cable modem assigned to guest Jon Fairbairn
2009-08-28 18:35 ` Brian Jackson
2009-08-29  9:24   ` Jon Fairbairn
2009-08-29 17:03     ` Jim Paris
2009-09-12  7:51       ` Jon Fairbairn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.