PV, TPS, QPS calculation formula

English explanation:

PV=page view
TPS=transactions per second
QPS=queries per second
RPS=requests per second

RPS = number of concurrent / average response time

 

Terminology Description:

QPS = req/sec = requests/sec

[How QPS calculates PV and machines]

QPS statistics method [usually use http_load for statistics]
QPS = total number of requests / (total number of processes * request time)
QPS: the number of successful requests to the server per second by a single process

Single server daily PV calculation
formula 1: Daily total PV = QPS * 3600 * 6
Formula 2: Daily total PV = QPS * 3600 * 8

Server count
number of servers = ceil (total PV per day / total PV per server per day)

[Peak QPS and machine calculation formula]

Principle: 80% of the daily visits are concentrated in 20% of the time, and this 20% time is called the peak time
formula: (total PV number * 80% ) / (number of seconds per day * 20% ) = number of requests per second (QPS) at peak time )
machine: QPS per second for peak time / QPS per machine = required machine

Q: How many QPS does this machine need on a single machine with 300w PV per day?
Answer: ( 3000000 * 0.8 ) / (86400 * 0.2 ) = 139 (QPS)

Q: If the QPS of a machine is 58, how many machines are needed to support it?
Answer: 139 / 58 = 3


In a typical work check-in system, users go to work at 8:00 in the morning, and users will log in to the check-in system to check in within 30 minutes from 7:30 to 8:00. The company has 1,000 employees, and the average time for each employee to log in to the sign-in system is 5 minutes. It can be calculated in the following way.
QPS = 1000/(30*60) Transactions/sec
Average Response Time = 5*60 Seconds
Concurrency = QPS* Average Response Time = 1000/(30*60)*(5*60)=166.7

 

Reference link:

http://www.ha97.com/5095.html

http://blog.csdn.net/wind19/article/details/8600083

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326409657&siteId=291194637