Page 1 of 1

Slow FTP uploads

Posted: 15. Jan 2009, 13:37
by Aldo Caruso
Hi,
I'm using virtualbox-ose 1.5.6 on Ubuntu 8.04 as host with Windows XP as guest and I'm experiencing very slow ftp uploads.
I also tried virtualbox-2.1 ( the non open source edition ) and the problem persists.

Thanks in advance for any help,

Aldo

Posted: 19. Jan 2009, 21:16
by Aldo Caruso
The problem only happens with NAT ( doesn't happen with Host Interface )
Any idea ?

Posted: 19. Jan 2009, 22:41
by sej7278
Aldo Caruso wrote:The problem only happens with NAT ( doesn't happen with Host Interface )
depends where you're ftp'ing to or from - i mean if you're ftp'ing to a local box, with nat its probably routing out onto the internet and back into your lan!

why not just use host interface?

Posted: 20. Jan 2009, 01:59
by Aldo Caruso
I'm doing ftp to an internal Linux box from a virtual machine running in another internal Linux box. There is no reason why network packets should go to Internet, as NAT in this case is SNAT ( only the source IP address gets changed, not the destination ).
Network packets exiting the machine where the VM is running look like packets originated by the host machine, having its IP address as source.
On the other hand, I'm using NAT for the following reasons:
1) It's simpler to configure.
2) I don't "waste" another IP address on my LAN.
3) The VM, which is running Windows, can't be accessed unless I explicitly configure port forwarding, That's pretty sure.

Thanks in advance for any clue.

Posted: 20. Jan 2009, 04:18
by TerryE
Actually NAT isn't simpler to configure with 2.1 since the setup is a similar drop-down box selection and you don't need to bother with port forwarding.

If you want to connect multiple VMs within the one host then why don't just add a second virtual NIC to both machines and configure this as internal networking. That way the "ethernet" traffic will be routed by Vbox directly from one VM to the other.

Posted: 20. Jan 2009, 13:13
by Aldo Caruso
I agree on the fact that in 2.1 both ( NAT and Host Interfaces ) are simpler to configure than on previous versions.

On the other hand I don't want to connect multiple virtual machines within one host, but a virtual machine running in one Linux host to an ftp server running in other Linux host.

To clarify thins, this is the scenario:

Machine A: Linux Host + Virtual Box running Windows XP as Guest.
Machine B: Linux running an ftp server and a samba server. ( no virtual machine ).
Both machines are on a LAN with no Internet connection.

My simple question is: why upstreaming with NAT configuration in the VM is so slow ? ( I checked that it doesn't depend on the protocol: both ftp and samba are slow, and I checked that it hasn't to do with "sending packets to Internet" as I disconneted the LAN from Internet )

Thanks,
Aldo

Posted: 20. Jan 2009, 14:34
by hankedr
Aldo Caruso wrote:To clarify thins, this is the scenario:

Machine A: Linux Host + Virtual Box running Windows XP as Guest.
Machine B: Linux running an ftp server and a samba server. ( no virtual machine ).
Both machines are on a LAN with no Internet connection.

My simple question is: why upstreaming with NAT configuration in the VM is so slow ? ( I checked that it doesn't depend on the protocol: both ftp and samba are slow, and I checked that it hasn't to do with "sending packets to Internet" as I disconneted the LAN from Internet )
Assuming that the speed is acceptable from the linux host, then I'll add that we see very substantial slowdown in RDP when using NAT when the host is running a 64-bit kernel. This is for 2.0.6 and on both Linux and Solaris hosts with XP as the guest. The RDP is via port forwarding to the guest rather than VRDP, and the problem is less severe with the 32-bit linux kernel (tested on a differenent machine, however). Our workaround was to use host interface networking (on Solaris, where 2.0.6 has similar config as 2.1.0). Release 2.1.0 claims to have improvements in NAT performance, but we haven't tested.

Posted: 20. Jan 2009, 17:53
by Aldo Caruso
I do tested NAT in release 2.1 and I found no improvement in upload speed.

Posted: 20. Jan 2009, 18:14
by TerryE
Aldo, I am not a develop (at least in terms of being a member of the Sun VBox team), just a community member so I can't really answer this one. I assume that you are using PASV otherwise your FTP wouldn't work over NAT. I can't think of a reason, other than NAT was know to be slow. I use SSH based copy rather than NAT for file transfer to and from my VMs.

Posted: 20. Jan 2009, 18:53
by Aldo Caruso
Terry,
Yes, I'm using PASV. Remind that also samba uploads are slow, so it's not an ftp issue.

Thanks.

Posted: 20. Jan 2009, 20:25
by TerryE
Aldo, this is getting bizarre. I did a quick test copying a file from (a) a Host IF based VM, (b) a NAT based VM, and (c) my AMD64 host. The VMs are running 32bit Ubuntu and the host 64bit. The Host is cable connected to my router and my XP laptop (where I did the test) is Wifi connected @ 54Mbps. The results were:

Code: Select all

>pscp test@forumLAMP:/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* .
gb.archive.ubuntu.com_ubu | 19980 kB | 540.0 kB/s | ETA: 00:00:00 | 100%
>pscp test@forumLAMP:/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* .
gb.archive.ubuntu.com_ubu | 19980 kB | 570.9 kB/s | ETA: 00:00:00 | 100%

>pscp -P 2221 test@ellison4.home:/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* .
gb.archive.ubuntu.com_ubu | 19980 kB | 832.5 kB/s | ETA: 00:00:00 | 100%
>pscp -P 2221 test@ellison4.home:/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* .
gb.archive.ubuntu.com_ubu | 19980 kB | 832.5 kB/s | ETA: 00:00:00 | 100%

>pscp terry@ellison4.home:/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* .
gb.archive.ubuntu.com_ubu | 19780 kB | 682.1 kB/s | ETA: 00:00:00 | 100%
>pscp terry@ellison4.home:/var/lib/apt/lists/gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* .
gb.archive.ubuntu.com_ubu | 19780 kB | 682.1 kB/s | ETA: 00:00:00 | 100%
Everything was a lot slower than I anticipated and slower than I get with Samba, but the comparisons were odd. The fastest was NAT from the 32bit VM ( 832.5 kB/s), next was from the 64bit host (682.1 kB/s) and last was host IF from the 32bit VM (540.0 kB/s). So I then did the write copy instead

Code: Select all

>pscp gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* terry@ellison4.home:/tmp
gb.archive.ubuntu.com_ubu | 19980 kB | 1665.0 kB/s | ETA: 00:00:00 | 100%
>pscp gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* terry@ellison4.home:/tmp
gb.archive.ubuntu.com_ubu | 19980 kB | 1665.0 kB/s | ETA: 00:00:00 | 100%

>pscp -P 2221 gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* test@ellison4.home:/tmp
gb.archive.ubuntu.com_ubu | 19980 kB | 1665.0 kB/s | ETA: 00:00:00 | 100%
>pscp -P 2221 gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* test@ellison4.home:/tmp
gb.archive.ubuntu.com_ubu | 19980 kB | 1665.0 kB/s | ETA: 00:00:00 | 100%

>pscp gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* test@192.168.1.77:/tmp
gb.archive.ubuntu.com_ubu | 19980 kB | 1665.0 kB/s | ETA: 00:00:00 | 100%
>pscp gb.archive.ubuntu.com_ubuntu_dists_hardy_universe_binary-* test@192.168.1.77:/tmp
gb.archive.ubuntu.com_ubu | 19980 kB | 1665.0 kB/s | ETA: 00:00:00 | 100%
So the writes to the host and VMs take exactly the same time. I did wonder if this was some artifact of the disk encyption s/w and virus scanner on my laptop so I retried this from another PC on my home LAN and got similar timings. I did suspect that my crappy router had maybe autosensed the wired link to my test server at 10Mbps rather than 100Mbps, but the 1.6Mb/s copy rates are too high for this. I need to thing about this. Very confusing! However, what this does show is that tracking down a performance bottleneck in an end-to-end system can be very difficult.

Posted: 21. Jan 2009, 03:20
by Aldo Caruso
Terry,

May be the remarkable slow connection has to do with the protocol ( you are using scp while I'm using ftp and samba ).

Nevertheless remains the fact that in both cases ( yours and mine ) the speed is slower than expected ( sometimes down to 10 % of available band width ).

My tests have been done with an ftp client on Windows XP Guest ( FileZilla ) uploading to a Linux FTP server ( vsftp ).

I reproduced this scenario with different machines ( house, job, etc. ) and the results are systematic: Uploading ftp or samba to from a virtual machine with a NAT connection progresses by bursts and ends with an average speed of less than 10% of the available band witdh.

Aldo