From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bei Guan Subject: The data transfer speed between two VMs -- a comparison between Xen libvchan and SCP? Date: Sun, 23 Mar 2014 00:28:46 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3644537995681367772==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org --===============3644537995681367772== Content-Type: multipart/alternative; boundary=047d7bdc952c21291904f5347fb5 --047d7bdc952c21291904f5347fb5 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Hi All, I try to make a comparison between the Xen libvchan and SCP with respect to the data transfer speed between two co-located VMs. The following is what I have done. 1. I modify the code tools/libvchan/node.c to transfer a file between two P= V DomUs. I set the buffer size to 2048, which is the data size writing into the shared ring every time. (Please refer to the line 78 in node.c=A3=A9 2. I use the command "time" to get the rough time of transferring a file between two PV DomUs under the SCP and Xen libvchan. The size of the file to transfer is 50M, 100M, 500M. The test result is posted behind. However, I find that the data transferred time does decrease much under the Xen libvchan when compared to the SCP. I also set the buffer size to 4096, 5000, 10000, and so on. The Xen libvchan doesn't show a better performance. It doesn't perform "around 30-40% faster than TCP for 4KB request sizes". (Like the paper[1] said.) Is there any wrong with my test? How to show the advantage of the Xen libvchan? Or say the advantage of the shared memory mechanism between Xen PV DomUs? [1] "The case for reconfigurable I/O channels" http://www.freebsdlabs.com/~robert/papers/201203-resolve-reconfigurable-io.= pdf =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The test result: The time to transfer a file under the Xen libvchan. (BufferSize is 2048) The files testdata_50m, testdata_100m, testdata_500m are files with size of 50M, 100M and 500M, respectively. # time ./node testdata_50m *real 0m2.795s* user 0m0.243s sys 0m0.784s # time ./node testdata_100m *real 0m5.707s* user 0m0.196s sys 0m1.943s # time ./node testdata_500m *real 0m28.680s* user 0m2.057s sys 0m8.601s The time to transfer a file under the SCP. # time scp testdata_50m root@192.168.160.226:/root/tmp testdata_50m 100% 50MB 25.0MB/s 00:02 *real 0m2.326s* user 0m1.485s sys 0m0.409s # time scp testdata_100m root@192.168.160.226:/root/tmp testdata_100m 100% 100MB 20.0MB/s 00:05 *real 0m4.271s* user 0m2.815s sys 0m0.811s # time scp testdata_500m root@192.168.160.226:/root/tmp testdata_500m 100% 500MB 20.8MB/s 00:24 *real 0m24.641s* user 0m15.354s sys 0m4.246s >>From the time above, we can see that the time to transfer a file under Xen libvchan is larger than that under the SCP. Why it happened? Doesn't the Xen libvchan show a better performance? Thank you for your time. I appreciate your any suggestions. --=20 Best Regards, Bei Guan --047d7bdc952c21291904f5347fb5 Content-Type: text/html; charset=GB2312 Content-Transfer-Encoding: quoted-printable
Hi All,

I try to make a comp= arison between the Xen libvchan and SCP with respect to the data transfer speed between two co-located= VMs. The following is what I hav= e done.
1. I modify the code tools/libvchan<= /span>/node.c to transfer a file between two PV<= /span> DomUs. I set the buf= fer size to 2048, which is the data size writing into the shared ring every= time. (Please refer to the line 78 in node.c=A3=A9
2. I use the command "time" to get the rough time of transfe= rring a file between two PV DomUs under the SCP and Xen libvchan. Th= e size of the file to transfer is 50M, 100M, 500M. The test result is = posted behind.

However, I find that the data transferred time does dec= rease much under the Xen libvchan when compared to the SCP. I also set the = buffer size to 4096, 5000, 10000, and so on. The Xen libvchan doesn't s= how a better performance. It doesn't perform "around 30-40% faster= than TCP for 4KB request sizes". (Like the paper[1] said.)

Is there any wrong with my test? How to show the advant= age of the Xen libvchan? Or  say the advantage of the shared memory me= chanism between Xen PV DomUs?


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
The t= est result:
The time to transfer a file under the Xen libvchan. (= BufferSize is 2048)
The files testdata_50m, testdata_100m,&n= bsp;testdata_500m are files with size of 50M, 100M and 500M, respectively.<= br>

# time ./node testdata_50m
real    0m2.795s
user    0m0.24= 3s
sys =    0m0.784s
# time ./node testd= ata_100m 
real   &nbs= p;0m5.707s
user    0m0.196s
sys    0m1.94= 3s
# time ./node testd= ata_500m 
real   &nbs= p;0m28.680s
user    0m2.057s
sys    0m8.6= 01s


The time to transfer a file under the SC= P.
# time = scp testdata_50m root@192.168.160.226:/root/tmp
testdata_50m=                     &nbs= p;         100%   50MB  25.0MB/s   00:02=    
real    0m2.3= 26s
user    0m1.485s
sys   &= nbsp;0m0.409s
# time scp testda= ta_100m root@192.168.160.226:/root/tmp
testdata_100= m                     &nb= sp;        100%  100MB  20.0MB/s   00:05=    
real    0m4.2= 71s
user    0m2.815s
sys   &= nbsp;0m0.811s
# time scp testda= ta_500m root@192.168.160.226:/root/tmp
testdata_500= m                     &nb= sp;        100%  500MB  20.8MB/s   00:24=    
real    0m24.= 641s
user    0m15.354s
sys   &= nbsp;0m4.246s

From the time above, we can se= e that the time to transfer a file under Xen libvchan is larger than that u= nder the SCP. Why it happened? Doesn't the Xen libvchan show a better p= erformance?

Thank you for your time. I appreciate your any suggesti= ons.

--
Best Regards,
Bei Guan
--047d7bdc952c21291904f5347fb5-- --===============3644537995681367772== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============3644537995681367772==--