Playing with Tencent Cloud CVM to test external network bandwidth
Published: 2022-07-15 07:48:46

In the cloud environment, CVMs generally access the network through multi-line BGP. In the actual use process, users may encounter situations where the bandwidth of the external network does not meet expectations. Under normal circumstances, as long as the terminal operator is a domestic and foreign mainstream operator, the operator will directly interconnect with Tencent Cloud, and the inbound and outbound bandwidth of CVM can meet expectations. If the client is a small operator and there is no access to the cloud, the inbound and outbound bandwidth of the CVM is often not up to the standard due to cross-operator communication. In this case, it is generally necessary to use a third-party speed measurement tool to prove that the inbound and outbound bandwidth on the cloud is normal.
Generally for bandwidth and latency testing, Speedtest is usually used, which is the most popular and most reliable method for measuring Internet performance. With Speedtest, you can accurately test the connection speed of any device at any time at home, at work, or on the go. Speedtest does not rely on background testing to covertly collect data at inappropriate times. Speedtest's analytics are based solely on actual internet speeds experienced by hundreds of millions of consumers around the world. Speedtest has 8,500 test points around the world, which can guarantee the greatest possible measurement of the real actual bandwidth during the test.
# Windows System Bandwidth Test

The test method for Windows is relatively simple. You only need to use the flow device to visit the https://www.speedtest.net website to test. The webpage is based on html5 and can be tested without installing the Flash plug-in on the client side. The system will automatically recommend the nearest test point for testing according to the client's access IP address, and you can directly click the GO button to test.
![image](https://ask.qcloudimg.com/draft/1919442/kwbuf3rhwr.png?imageView2/2/w/1620)Visit Speedtest.net website and click the GO button to test
First, the delay is tested. The delay test is based on the delay statistics from the client to the speedtest test node. The download bandwidth and upload bandwidth of the client are tested. After the test, the maximum value of the final test result will be printed.

![image](https://ask.qcloudimg.com/draft/1919442/paaz8psj4o.png?imageView2/2/w/1620)Speedtest test results display
# Linux system bandwidth test

Since most of the Linux systems on the cloud do not have a desktop environment installed, the browser is used to access the speed test website for testing. This article uses the test script provided by Speedtest to perform network testing on the command line interface. For specific test scripts, you can visit [GitHub](https://github.com/suxin1110/SpeedTest) to download the test scripts, or run the following commands directly on the system to download:
  `git clone https://github.com/suxin1110/SpeedTest.git` 
The downloaded py script needs to execute the following command to directly perform the delay and external network inbound and outbound bandwidth test in bash
 `chmod a+rx speedtest.py` 
 `sudo mv speedtest.py /usr/local/bin/speedtest` 
 `sudo chown root:root /usr/local/bin/speedtest` 
At this point, you can directly type speedtest in bash to test, or test the delay first, and then test the download and upload bandwidth from the Internet.
![image](https://ask.qcloudimg.com/draft/1919442/80ooyb5az2.png?imageView2/2/w/1620)Enter the speedtest command on the Linux command line interface to start the test script
Here are some simple speedtest test commands
 `speedtest ` 
 `speedtest --share ` 
 `speedtest --list ` 
 `speedtest --server *** ` 
For detailed speedtest test commands, you can directly type speedtest -h to view the help description.