VirtualBox,使用nat上传速度慢

我在Ubuntu 12.04服务器(主机)上运行Virtualbox,并以guest虚拟机操作系统运行Windows 7。 我正在使用(虚拟)英特尔PRO / 1000 MT网卡。

使用nat和桥接networking设置,我可以获得良好的networking性能,但使用nat上传速度非常慢。

我把这个绑在了不同的服务器上,一个新的,一个几岁的,都给出了同样的结果。

如果你能解释这种行为或有进一步的testing的想法,我可以执行,请让我知道。

我使用了以下设置:

modifyvm <vm> --natsettings1 1500,1024,1024,1024,1024 

这是基于http://www.virtualbox.org/manual/ch09.html#nat-adv-settings

 --natsettings<1-N> [<mtu>],[<socksnd>],[<sockrcv>],[<tcpsnd>], [<tcprcv>] 

它看起来像一个dev发送速度与下载速度的单位转换问题。 默认情况下,“tcprcv”比“tcpsnd”要高一些。

在Ubuntu 14.04上,我不得不使用virtio网卡types从VirtualBox中获得体面的速度:

 modifyvm --nictype1 virtio 

我做了一个基准testing。

=摘要=

  1. 如果可能的话使用桥接适配器,它比NAT快得多。

  2. 对于多个连接(赢家)的吞吐量:

     --natsettings1 1500,64,64,64,1024 
  3. 对于单一连接的吞吐量:

     --nictype1 Am79C973 
  4. 在其他环境中,我听说过有关virtio的好消息。

=详细的测量=

  # host os: windows7 # guest os: ubuntu14 # natsettings: $mtu,$socksnd,$sockrcv,$tcpsnd,$tcprcv # list of space separated results in Mbit/s from: # iperf -c other-box -P $x # --natsettings 16000,1024,1024,1024,1024 # https://twitter.com/alphazo/status/142200878068277248 # x:=1 : 70 100 120 97 99 # x:=4 : 574 517 519 497 548 # x:=8 : 552 585 509 613 597 # --natsettings 16000,128,128,0,0 # http://en.helpdoc-online.com/virtualbox_4.1.2/source/ch09s11.html # x:=1 : 57 48 52 46 54 # x:=4 : 150 146 134 154 182 183 # x:=8 : 204 171 277 195 186 # --natsettings 1500,1024,1024,1024,1024 # http://serverfault.com/questions/447775/virtualbox-slow-upload-speed-using-nat/450734#450734 # x:=1 : 67 69 74 86 63 # x:=4 : 514 520 614 # x:=8 : 549 579 572 # --natsettings 1500,64,64,64,1024 # https://www.virtualbox.org/ticket/10034?cversion=0&cnum_hist=8 # http://www.kiwix.org/wiki/Black%26White_Project/Compilation_Farm/Setup # x:=1 : 99 74 71 85 96 119 103 83 107 80 # x:=4 : 647 696 688 677 701 540 582 498 510 533 # x:=8 : 610 666 622 607 677 586 510 528 # --natsettings 1500,64,64,64,2048 (my experiment 7) # x:=1 : 81 62 57 # x:=4 : 179 146 151 # --natsettings 1500,64,64,64,512 (my experiment 8) # x:=1 : 55 63 75 # x:=4 : 377 380 477 # x:=8 : 412 544 485 # x:=16: 174 379 376 # --natsettings 1500,64,64,64,1024 (repeat) # x:=4 : 673 680 745 # --natsettings 16000,64,64,64,2048 (my experiment 9) # x:=1 : 48 47 59 # x:=4 : 123 149 # --natsettings 1500,64,64,64,1280 (my experiment 10) # x:=1 : 43 47 46 # x:=4 : 145 149 159 # --natsettings 1500,64,64,64,768 (my experiment 11) # x:=1 : 58 79 95 # x:=4 : 566 470 510 # --natsettings 1500,64,64,64,640 (my experiment 12) # x:=1 : 75 88 56 # x:=4 : 550 491 547 # x:=8 : 549 532 # --natsettings 1500,128,128,128,1024 (my experiment 13) # x:=1 : 70 109 57 # x:=4 : 503 480 549 596 # --natsettings 1500,32,32,32,1024 (my experiment 14) # x:=1 : 73 81 108 # x:=4 : 582 598 511 # x:=8 : 550 675 563 # --natsettings 16000,256,256,0,0 # http://stackoverflow.com/questions/26389285/vagrant-waiting-for-chef-zero-to-start # x:=1 : 64 41 60 41 # x:=4 : 143 184 147 # x:=8 : 122 204 210 # --natsettings 1500,4096,4096,1024,1024 (my experiment 1) # x:=1 : 130 93 87 109 104 # x:=4 : 524 565 559 566 # x:=8 : 556 607 552 543 536 588 # --natsettings 16000,4096,4096,1024,1024 (my experiment 2) # x:=1 : 84 69 78 66 86 # x:=4 : 517 525 575 540 560 # x:=8 : 566 576 575 # --natsettings 16000,8182,8182,8182,8182 (my experiment 3) # x:=1 : 53 60 53 48 47 # x:=4 : 170 161 177 # x:=8 : 175 203 253 177 # --natsettings 16000,8182,8182,128,128 (my experiment 4) # x:=1 : 34 44 45 45 # x:=4 : 221 236 196 # x:=8 : 224 277 266 # --natsettings 16000,128,128,8182,8182 (my experiment 5) # x:=1 : 48 38 50 # x:=4 : 165 203 190 # x:=8 : 207 186 204 # default natsettings # x:=1 : 41 49 46 58 48 # x:=4 : 171 152 176 149 161 # x:=8 : 215 203 258 208 194 # bridged adapter (82540EM) # x:=1 : 826 681 860 732 824 688 788 660 665 660 731 924 787 # fantastic speeds! :D # x:=4 : 666 691 689 680 684 # x:=8 : 588 587 581 572 592 # --nictype1 virtio (default natsettings) # x:=1 : 13 15 14 # x:=4 : 70 82 50 # x:=8 : 244 96 103 # x:=16: 103 111 196 111 96 # --nictype1 Am79C970A (default natsettings) # x:=4 : 210 233 237 # --nictype1 Am79C973 (default natsettings) # x:=4 : 215 244 224 # --nictype1 82540EM (default natsettings) # x:=4 : 165 153 200 184 # --nictype1 82543GC (default natsettings) # x:=4 : 133 147 173 # --nictype1 82545EM (default natsettings) # x:=4 : 153 130 151 # --nictype1 Am79C973 --natsettings 1500,64,64,64,1024 (my experiment 6) # x:=1 : 172 118 145 117 107 # really good! # x:=4 : 372 368 364 372 370 # why so bad? # x:=8 : 358 360 363