When the customer tried to continuous testing which is considering the real usage, the customer got the error message like: MySQLNonTransientConnectionException: Too many connections from MySQL. And we found that the connection threads exceeded to over 151 connections(which value is the upper limit)
The customer checked the connection threads and there was the connection which took over 5 hours, and we also checked the time out value(wait_timeout) in MySQL and the value was 28.800 seconds(8hours) and this will cause the problem.
The customer changed the wait_timeout values as 60 seconds and the number of connection threads kept near 10 and became stable.
To change the value of wait_timeout, we want to ask two questions