Conversion between PV and concurrency algorithm conversion formula + calculate bandwidth by PV __ algorithm

Source: Internet
Author: User
Tags ip number

calculate bandwidth based on PV


We usually say that the site traffic (traffic) refers to the amount of visitors to the site, is used to describe the number of users to visit a website and the number of pages visited by users, and other indicators, commonly used statistical indicators include the number of independent users of the site, the total number of users (including repeat visitors), The number of page views per user, the average length of time a user stays on the site, and so on.
Website traffic measurement of the standard one is IP, the other is PV, often with the day as the standard, independent IP and PV to calculate.
Access Number (IP): Internet Protocol, refers to the number of independent IP. The same IP address within the 00:00-24:00 is computed only once.
Comprehensive view (PV): That is, Page view, which is the number of pages viewed or clicked, the user is calculated once every refresh.
The connection and difference between the two: PV high does not necessarily represent many visitors, PV and the number of visitors in direct proportion, but PV does not directly determine the actual number of visitors to the page. For example, a site you come in, through the constant refresh page, you can also create a very high PV.
IP is a reflection of the concept of network virtual address object, independent user is a reflection of the concept of actual users, each independent user relative to each IP, more accurately corresponding to a real browser. Using an independent user as a statistic, you can more accurately understand how many visitors actually arrive at the corresponding page in the unit time.
An independent IP can produce multiple PV, so PV number >=ip number.
PV (page View): Refers to the number of pages that are requested by all visitors to the site within a certain time span. (For example: the site has 500 visitors a day, each visitor browsing the average number of pages of 8 pages, the daily PV is 500x8=4000)
Hits Value: Refers to the number of requests per page element. (any picture or flash file in a page is a page element)
Day Browsing bytes: The same day traffic is the sum of the bytes of all page elements requested by the visitor within a single date.

Calculating the bandwidth size requires two metrics: peak traffic and the average page size. Let me give you an example of how to:

Assuming that the peak flow of the site is 5 times times the average traffic (of course, this is only a hypothetical, specific implementation we need to depend on their own circumstances);
Assume that the average page size for each visit is 200K bytes;
Assume that the site's intended target is 50W PV traffic per day.
Our calculations begin with: 50W PV if the average distribution in a day, the equivalent of 50w/(24*60*60) = 6 visits per second, according to our previous assumption that the average page size is 200K byte, the total of these 6 visits is 1200K bytes (Note that this place is byte), The unit of bytes is byte, and the unit of bandwidth is bit,1byte=8bit, so the 1200K byte is probably the 9600K bit, which is 9Mbps (1m=1024k). In the actual operation of the Web site, our site must be in peak traffic to maintain normal access, here will be used to our previous assumptions, peak flow is 5 times times the average flow, according to this calculation, the actual need for bandwidth around 9mbps*5=45mbps.
the specific calculation formula is: Website Exclusive bandwidth = Total PV value of the day total day (conversion to s) * Average page size (in KB) * 8
The premise of this calculation is our previous three assumptions, and in the actual operation, due to caching, the Web site to provide downloads, more pictures, the site during the day and night visits are different, and other reasons, this result may not be ideal. So this algorithm is only a rough algorithm.
eg. 10w PV, page size 1M, bandwidth =10,0000/86400*1m*8 = 9.26Mbps



algorithm conversion formula for conversion between PV and concurrency


Concurrent connections = PV/Statistic time * Page Derivation Connection number * HTTP response time * Factor/number of Web servers
PV = Concurrent Connections * Statistic time * Number of Web servers/page derived connections/HTTP response time/factor
Explain:
Statistic time: PV statistics total time, unit seconds, to calculate the PV is 86,400 seconds a day
Number of page derivative connections: An HTML page may request several HTTP connections, such as external CSS, JS, pictures, etc., can be estimated, or 10, can be changed according to the actual situation
HTTP response time: can be used 1 seconds or less, can be changed according to the actual situation
Factor: General use 5 can, according to the actual situation calculation after the launch
Number of Web servers: number of Web servers
* "Page derived connection times", "HTTP Response time", "factor" three parameters to be analyzed and calculated according to the actual situation, to determine a suitable value
Calculate. Single Machine 1000 concurrent case, one day is 1,728,000 PV (1 second response, 10 derivative connection, Factor 5)
======================================================================
Example:
The formula for calculating the number of concurrent connections per day for PV is:
Number of concurrent connections = PV/statistic time (one day is 86400) * Page derivation number of connections * HTTP response time * FACTOR (5)/number of Web servers
The number of concurrent connections for 40 million PV is guaranteed:
(40000000pv/86400 seconds * 10 Derived connections * 5 seconds response * 5 times times Peak)/6 Web server = 19290 Connection number

eg.

Number of concurrent connections for 10PV:
(100000pv/86400 seconds * 10 Derived connections * 5 seconds response * 5 times times Peak)/1 Web server = 289 Connection number

Pick up the star in the sky




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.