Question:I created two VMs on Azure, one at Australia East and the other at Brazil South. The two VMs are of classic model and run Ubuntu 16.04. I created endpoints on these VMs and ran a server-client program (in C++) on these VMs. I observed a very high latency. Transferring 2MB roughly took 4 seconds. I need very low latency for my application (less than 0.1-0.2 seconds for transferring 2 MB). How can I achieve that (or even close to that)? Is there a way to prioritize my network traffic? Is there a way to buy more bandwidth on Azure? Is there a way to remove firewall on Azure, which might reduce latency?
Is there a way to buy more bandwidth on Azure?
What is the size of your VM? Increase VM size could increase VM’s bandwidth. You could use
iperf3to test bandwidth between your VMs. Here is my result. My VM is A0 size.
I test in my lab,
root@shui:~# iperf3 -c 184.108.40.206 Connecting to host 220.127.116.11, port 5201 [ 4] local 10.0.0.4 port 37260 connected to 18.104.22.168 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 360 KBytes 2.95 Mbits/sec 0 55.8 KBytes [ 4] 1.00-2.18 sec 487 KBytes 3.39 Mbits/sec 0 123 KBytes [ 4] 2.18-3.00 sec 1.41 MBytes 14.3 Mbits/sec 0 266 KBytes [ 4] 3.00-4.00 sec 1.17 MBytes 9.83 Mbits/sec 1 282 KBytes [ 4] 4.00-5.00 sec 600 KBytes 4.91 Mbits/sec 0 283 KBytes [ 4] 5.00-6.00 sec 1.17 MBytes 9.83 Mbits/sec 0 291 KBytes [ 4] 6.00-7.18 sec 660 KBytes 4.57 Mbits/sec 0 300 KBytes [ 4] 7.18-8.00 sec 1.35 MBytes 13.8 Mbits/sec 0 336 KBytes [ 4] 8.00-9.00 sec 720 KBytes 5.89 Mbits/sec 0 379 KBytes [ 4] 9.00-10.00 sec 1.70 MBytes 14.2 Mbits/sec 0 442 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 9.55 MBytes 8.01 Mbits/sec 1 sender [ 4] 0.00-10.00 sec 7.96 MBytes 6.67 Mbits/sec receiver
iperf3has been install on Azure Ubuntu 16.04. Test method.
On one VM run iperf in server mode, you should open port 5201 on Endpoint.
On another VM run single thread test:
$ iperf3 -s
For the multi thread test:
$ iperf3 -c ip-of-server
Where n = number of cores in VM
$ iperf3 -c ip-of-server -P n
More test result you could refer to this blog.
Is there a way to prioritize my network traffic?
Based on my knowledge, you could prioritize your network as the following three aspects.
1.Select suitable VM size
You could test VM bandwidth on you lab and select suitable VM size. You could refer to this link:High performance compute Linux VM sizes.
2.Optimize your code and algorithms.
3.If you have a very high network delay requirement, I suggest you could select Azure BGP. You also could refer to this link.
If you have better answer, please add a comment about this, thank you!