The meaning and calculation method of QPS and TPS of database
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Unfortunately, people often delete certain contacts accidentally for some reasons. WeChat is a widely used social software. To help users solve this problem, this article will introduce how to retrieve deleted contacts in a simple way. 1. Understand the WeChat contact deletion mechanism. This provides us with the possibility to retrieve deleted contacts. The contact deletion mechanism in WeChat removes them from the address book, but does not delete them completely. 2. Use WeChat’s built-in “Contact Book Recovery” function. WeChat provides “Contact Book Recovery” to save time and energy. Users can quickly retrieve previously deleted contacts through this function. 3. Enter the WeChat settings page and click the lower right corner, open the WeChat application "Me" and click the settings icon in the upper right corner to enter the settings page.

Mobile games have become an integral part of people's lives with the development of technology. It has attracted the attention of many players with its cute dragon egg image and interesting hatching process, and one of the games that has attracted much attention is the mobile version of Dragon Egg. To help players better cultivate and grow their own dragons in the game, this article will introduce to you how to hatch dragon eggs in the mobile version. 1. Choose the appropriate type of dragon egg. Players need to carefully choose the type of dragon egg that they like and suit themselves, based on the different types of dragon egg attributes and abilities provided in the game. 2. Upgrade the level of the incubation machine. Players need to improve the level of the incubation machine by completing tasks and collecting props. The level of the incubation machine determines the hatching speed and hatching success rate. 3. Collect the resources required for hatching. Players need to be in the game

Setting font size has become an important personalization requirement as mobile phones become an important tool in people's daily lives. In order to meet the needs of different users, this article will introduce how to improve the mobile phone use experience and adjust the font size of the mobile phone through simple operations. Why do you need to adjust the font size of your mobile phone - Adjusting the font size can make the text clearer and easier to read - Suitable for the reading needs of users of different ages - Convenient for users with poor vision to use the font size setting function of the mobile phone system - How to enter the system settings interface - In Find and enter the "Display" option in the settings interface - find the "Font Size" option and adjust it. Adjust the font size with a third-party application - download and install an application that supports font size adjustment - open the application and enter the relevant settings interface - according to the individual

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Mobile phone film has become one of the indispensable accessories with the popularity of smartphones. To extend its service life, choose a suitable mobile phone film to protect the mobile phone screen. To help readers choose the most suitable mobile phone film for themselves, this article will introduce several key points and techniques for purchasing mobile phone film. Understand the materials and types of mobile phone films: PET film, TPU, etc. Mobile phone films are made of a variety of materials, including tempered glass. PET film is relatively soft, tempered glass film has good scratch resistance, and TPU has good shock-proof performance. It can be decided based on personal preference and needs when choosing. Consider the degree of screen protection. Different types of mobile phone films have different degrees of screen protection. PET film mainly plays an anti-scratch role, while tempered glass film has better drop resistance. You can choose to have better

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

Age spots are a common skin problem that tend to appear on the faces of older adults on exposed areas such as the neck and back of hands. It will also make people look older. It not only brings trouble to people's appearance. With the advancement of science and technology and the development of beauty technology, there are now many simple and quick ways to remove age spots, however. To restore young and healthy skin and help you eliminate age spots quickly, this article will share some effective skin care tips. 1. The importance of actively protecting the skin from ultraviolet damage, so it is very important to avoid prolonged exposure to the sun. Ultraviolet rays are one of the main causes of age spots. 2. Choose skin care products reasonably and use products containing antioxidants and whitening ingredients. Skin care products containing antioxidants and whitening ingredients can help reduce the appearance of age spots.
