Home > Database > Mysql Tutorial > The meaning and calculation method of QPS and TPS of database

The meaning and calculation method of QPS and TPS of database

小云云
Release: 2017-11-17 13:52:45
Original
8028 people have browsed it

The terms QPS and TPS are often mentioned in database performance monitoring. Let’s briefly share the meaning and calculation methods of QPS and TPS in the MySQL database.

1. TPS: Transactions Per Second (number of transactions transmitted per second), that is, the number of transactions processed by the server per second. TPS includes one message in and one message out, plus one user database access. (Business TPS = CAPS × Average TPS per call)

TPS is the unit of measurement for software test results. A transaction refers to the process in which a client sends a request to the server and the server responds. The client starts timing when it sends a request and ends when it receives the server's response to calculate the time used and the number of completed transactions.

Generally, the evaluation system performance is measured by the number of technical transactions completed per second. The overall processing capacity of the system depends on the TPS value of the module with the lowest processing capacity.

2. QPS: Query rate per second QPS is a measure of how much traffic a specific query server handles within a specified period of time. On the Internet, the performance of a machine as a domain name system server is often measured in terms of per second. Measured by query rate.

Corresponds to fetches/sec, which is the number of response requests per second, which is the maximum throughput capability.

1 TPS: Transactions per second, the TPS value requested by the client application is obtained by the following method. The calculation method is as follows:

Questions = SHOW GLOBAL STATUS LIKE 'Questions';
Uptime = SHOW GLOBAL STATUS LIKE 'Uptime';
QPS=Questions/Uptime

2 QPS: The amount of Query per second, where QPS refers to the total amount of Query executed by MySQL Server per second, calculated The method is as follows:

Com_commit = SHOW GLOBAL STATUS LIKE 'Com_commit';
Com_rollback = SHOW GLOBAL STATUS LIKE 'Com_rollback';
Uptime = SHOW GLOBAL STATUS LIKE 'Uptime';
TPS= (Com_commit + Com_rollback)/Uptime

IOPS: (Input/Output Operations Per Second), which is the number of read and write (I/O) operations per second. It is mostly used in databases and other situations to measure the performance of random access. .

The IOPS performance of the storage side is different from the IO of the host side. IOPS refers to the number of accesses issued by the host per second that the storage can accept. An IO of the host requires multiple accesses to the storage to be completed. For example, when the host writes a minimum data block, it also needs to go through three steps: "sending a write request, writing data, and receiving a write confirmation", that is, three storage-side accesses.

The IOPS testing benchmark tools mainly include Iometer, IoZone, FIO, etc., which can be used comprehensively to test the IOPS of the disk under different situations. For application systems, it is necessary to first determine the load characteristics of the data, then select reasonable IOPS indicators for measurement and comparative analysis, and select appropriate storage media and software systems accordingly.

The above is the complete meaning and calculation method of database QPS and TPS. I hope everyone will have a deeper understanding of this.

Related recommendations:

The difference between concurrency and QPS

About MySQL’s TPS and QPS_MySQL

mysql status view QPS/TPS/cache hit rate view_MySQL

The above is the detailed content of The meaning and calculation method of QPS and TPS of database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template