In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what the MySQL database connection pool SMProxy is, the article is very detailed, has a certain reference value, interested friends must read it!
Swoole MySQL Proxy, a MySQL database connection pool based on MySQL protocol and Swoole.
Principle
The database connection is stored in memory as an object, and when the user needs to access the database, the connection is established for the first time, and then instead of establishing a new connection, an established idle connection object is extracted from the connection pool. After use, instead of closing the connection, the user puts the connection back into the connection pool for the next request for access. The establishment and disconnection of connections are managed by the connection pool itself.
At the same time, you can also set the parameters of the connection pool to control the initial number of connections in the connection pool, the upper and lower limits of connections, the maximum number of times to use each connection, the maximum idle time, and so on. You can also monitor the number and usage of database connections through its own management mechanism. If the maximum number of connections is exceeded, the cooperative program will be suspended until a connection is closed before resuming the cooperative program to continue operation.
Characteristics
-support for read-write separation
-supports database connection pooling, which can effectively solve the database connection bottleneck caused by PHP
-support for SQL92 standards
-using cooperative scheduling
-support multiple database connections, multiple databases, multiple users, flexible collocation
-abiding by MySQL native protocol, cross-language, cross-platform general middleware agent
-support for MySQL transactions
-support HandshakeV10 protocol version
-perfectly compatible with MySQL4.1-8.0
-compatible with major frameworks to improve performance seamlessly
Original intention of design
PHP does not have connection pooling, so the database will be full of connections when there is high concurrency, and some database middleware such as Mycat may fail to use SQL, for example, batch addition is not supported, and it is too bloated. So I wrote this lightweight middleware which only supports connection pooling and read-write separation. Using Swoole to schedule HandshakeV10 protocol forwarding makes the program more stable and does not have to parse all SQL packets like Mycat, which increases the complexity.
These are all the contents of the article "what is MySQL database connection pool SMProxy?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.