druid1.0.26 + tomcat7.0.70 + linux64大量time_wait,close_wait

Problem description: The program uses druid for database link management, and there is no problem in the windows test environment. Deployed to the test environment, and found that there are a large number of port statuses time_wat, close_wait after calling. There is no abnormality in the troubleshooting code.

1. Analyze the reasons for the time_wait and close_wait problems, check the code, and find that the httpclient resources mentioned on the Internet are not released.
2. According to the version analysis and improvement points, it is suspected that it is a druid problem.
3. Check the information and find that many friends have also had this problem. The main reason is that Druid manages the database link, which is not released in time after use, resulting in the failure to obtain the database link for subsequent requests.
There are two ways to come out: 1. Better other database link management methods
2. Use the timeout recovery mechanism of the druid connection pool, and add the following content to the configuration: For details, see
http://blog.csdn.net/peterwanghao/article/details /40071857

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326593383&siteId=291194637