Mysql persistent connection is a single-process, multi-threaded architecture.
Configuration parameters (for a single client)
Interactive_time execution (activity in activity State) times out
Wait_time wait for sleep
Max_connection
I was a php programmer and later switched to java. Why does mysql timeout occur when I connect to mysql for the second time in javaEE? After reading many articles, either add Reconnection = true or modify wait_time in my. cnf.
Scenario 1: a web program with a large number of php concurrencies. in this case, the php script timeout time and mysql execution time must be limited. Short link.
Scenario 2: If Client A needs to process data in batches, it is more appropriate to search for the client, so the persistent connection is more appropriate.
Recommended http://blog.sina.com.cn/s/blog_6f3ff2c90100otay.html
Http://www.php.net/manual/zh/pdo.connections.php