These days of work, in the use of MySQL database, encountered too many connections problem and timeout expired problem, after trying, a little summary, hoping to help the needs of friends;
Found in the test,
1:too Many connections error will be greater than the value of max_connections in max pool size, and connections in the connection pool are all occupied, and a new connection request occurs;
2:timeout expired error occurs when the value of max pool size is less than the value of max_connections, and the number of connections reaches the value of max pool size, and there is a new connection request;
For the first case, you can modify the maximum number of MySQL connection configuration to solve, modify the method is not elaborate, a lot of online;
For the second case, it can be resolved by modifying the configuration of the database connection string, involving two property names pooling and Max Pool size,pooling As Boolean, True, enabled, False, not enabled (enabling connection pooling is much more efficient than not enabling connection pooling), Max pool size is an int value;
Basically is this, hope can help the need of friends, if there is any place in the text is inaccurate, incorrect, incomplete, but also sincerely welcome friends advice;
MySQL max_connections and Max pool settings