How to choose the appropriate broadband size for the cloud server? Bandwidth calculation, network traffic, page size

1. Calculate the speed according to the bandwidth

How to calculate the network speed for the bandwidth selected when purchasing a server? Assuming that the bandwidth is 5Mbps, the simple calculation rules are as follows:
5 / 8 = 0.625 MB/s: the size of the data pulled from the server per second 0.625M
or
5 * 1024 / 8 = 640 KB/s: the size of the data pulled from the server per second is640K

Second, the detailed principle

Alibaba Cloud Bandwidth:

Reference: What is the difference between Alibaba Cloud 1M/2M/3M/5M bandwidth? how to choose?
After communicating with Alibaba Cloud's official customer service, I learned that the inbound bandwidth of Alibaba Cloud's bandwidth is 100M regardless of the bandwidth of 1M, 2M, 5M, or 10M. So the inbound bandwidth is the same, there is no difference.

Outbound bandwidth: The outbound bandwidth of the cloud server, also called outbound bandwidth. Providing external access from the cloud server, or downloading the internal resources of the cloud server from the client FTP, etc. are the outbound bandwidth, and the outbound bandwidth of the cloud server is the purchased bandwidth value.

Here is the 1M/2M/3M/5M bandwidth that we usually mention when purchasing cloud servers, which is the outbound bandwidth. The difference is that the outbound bandwidth is different.

For example: the bandwidth of the Alibaba Cloud server you purchased is 1Mbps, which means that when a user visits the website of your server, the part of the traffic that the user requests to reach the server is free, and the bandwidth of the public network is 100Mbps; then the server returns the data required by the user and transmits it to For users, this part is the outbound bandwidth, and the limit is 1Mbps.

3. Calculation formula of cloud server bandwidth and download speed: bandwidth * 1024 / 8 = theoretical download speed

The theoretical download speed of 1M public network bandwidth is 128k/s, and it is about 120k/s in normal use. The theoretical download speeds of 2M/3M/5M public network bandwidth are 256 k/s, 384 k/s, and 640 k/s respectively.

It can be seen that the greater the bandwidth, the greater the amount of data that can be downloaded per second, and the stronger the ability to allow customers to access at the same time. For example, the page size of https://www.vpsss.net/131355.html is 128K. If a customer needs to open this page within one second (the process of opening the page is actually the process of completely downloading the page from the cloud server to the visitor’s local computer. ), then it takes more than 1 second to open the 1M bandwidth. Because the theoretical transmission speed of 1M bandwidth is 128KB/s, this value is rarely reached in actual use; if two users open it at the same time, it will take 2 seconds to fully open the page respectively. If two users are required to open the page at the same time within 1 second (the user experience is good), the bandwidth should be increased to 2M.

I hope you understand what the above explanation means. Cost and availability (user experience) are related to each other. High availability means higher cost, and low cost means sacrificing part of user experience.

In actual use, for businesses with 1000PV~3000PV visits per day, there are fewer times when pages are opened concurrently. From the real-time visitor results page of Baidu statistics, you can see the number and details of visitors per minute, which illustrates this problem. Conversely, if the business visits exceed 5000PV, the statistical results show that there are many visitors and PVs per minute (requires long-term observation), and users report that the opening speed of the website exceeds 3 seconds, you should consider upgrading to a higher bandwidth.

In actual use, if your business is between 1000PV and 3000PV visits per day, and it takes 2 seconds to open the page and users will not feel the waiting time, then you can choose 1M bandwidth. Otherwise, please choose the bandwidth that suits you according to the actual situation of your business.

How much cloud server bandwidth is appropriate? Public network bandwidth estimation method

Reference: https://zhuanlan.zhihu.com/p/398009583

Server broadband unit conversion:

Byte (byte) and bit (bit): In general, we use uppercase B to represent Byte (byte), and lowercase b to represent bit (bit); 1Byte=8bit.
When we see the broadband claimed by the host provider, we need to figure out whether it is Byte or bit, because the difference between the two is 8 times! Generally speaking, the bandwidth of the host computer port in the computer room uses bits, so the download peak value of 1M broadband (1Mbps) is not 1M/s, which must be divided by 8.

In summary:

The download peak value corresponding to 1M broadband (1Mbps) is 128KB/sec (128KBps), the
download peak value of 2M broadband is 128K*2=256KB/sec,
and so on

We estimate the appropriate bandwidth value through IP, PV, page size, and concurrency.
PV (Page View) value: refers to the sum of the number of pages requested by all visitors browsing the website within a certain period of time. (For example: the website has 50 visitors a day, and the average number of pages viewed by each visitor is 5 pages, then the daily PV is 50×5=250)

Calculation bandwidth example:

假设平均网站每个页面的大小为30KB,网站同时在线人数峰值为1000人,假设十分之一的并发量即100人(假设1000个IP在线,并发峰值为100个),那么我们需要的宽带峰值为:
30KB*100=3000KB,约等于3M,我们希望网速快一些,这100并发产生的3M流量要在1秒内完成,所以:
3M*8=24M宽带
什么?100个并发就需要24M宽带?要这么多?因为我们假设这100并发请求流量在1秒内完成,稍微拉长下时间,宽带值也可以降一降。

Concurrent basic formula within 1 second
带宽Mbps = 并发数 * 页面大小Mb * 8

Example of calculating the number of concurrency:

30宽带
1个页面大小2M
1秒内能支持的并发数有多少?

30/8/2=1.875个并发数

Broadband purchasing skills:

个人网站流量不多,那么我就先选购1M的宽带,然后我们通过阿里云控制台的云监控功能,来查看网站的流量数据,如果宽带流量占用比较满,
那么我们可以再增加1M宽带(阿里云1M宽带每月大概是23元),
以此类推。这样选购宽带可以减少资源浪费,也更省钱!

Guess you like

Origin blog.csdn.net/u014438244/article/details/122232482