I mean, what is a connection? If a process connects to mysql and mysql assigns a process to connect to PHP, is this a connection? For example, the maximum number of connections in mysql is 50, does it mean that there are 50 waiters in the restaurant mysql, right? If you use persistence..., what does it mean to be a connection?
If a process connects to mysql and mysql assigns a process to connect to PHP, is this a connection?
For example, the maximum number of connections in mysql is 50, does it mean that there are 50 waiters in the restaurant mysql, right?
If persistent connection is used, it means that this waiter only serves a specific customer (php process), and other customers cannot use this waiter, right ???
Reply content:
I mean, what is a connection?
If a process connects to mysql and mysql assigns a process to connect to PHP, is this a connection?
For example, the maximum number of connections in mysql is 50, does it mean that there are 50 waiters in the restaurant mysql, right?
If persistent connection is used, it means that this waiter only serves a specific customer (php process), and other customers cannot use this waiter, right ???
You are right.
However, in the early stage of PHP, it is better to take the connection to complete the disconnection, because the database generally supports a low level of concurrent connections. The persistent connection you mentioned is generally used in the connection pool technology. The application code maintains the SQL queue by itself, which is used to thoroughly squeeze the database performance.
Mysql is a total of 50 places in your restaurant, and one is missing for each use. If your 50 seats are full. But guests can still come in to your restaurant. But there is no place to eat. There are too few meals (too few connections ). Increasing the number of connections means increasing the number of meals.