We have an application REST gateway deployed over jetty 9.0.3 server.For authentication and authorization of services deployed in jetty is taken care by apache commons-httpclient3.1. when there are huge number of concurrent threads hitting Rest gateway, lot of CLOSE_WAIT are piling up in REST gateway machine. Http connections which are opened for sending request to enabler(END POINT)are closed properly by calling releaseConnections method of apache commons. Please let me know how to handle these CLOSE_WAIT or any clues why connections are ending up in CLOSE_WAIT.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The close_wait connections vanished when closeIdleConnections(0) provided by Apache commons http Client 3.1. But now too many TIME_WAIT are getting established and back end i am getting errors like "Address already in use" :(
Finally CLOSE_WAIT connections were not seen after using closeIdleConnections(0). Hope this solution might help others :)
回答2:
CLOSE_WAIT
means that TCP is waiting for the local application to close its end of the connection, which has already been closed by the peer.
Ergo you aren't closing them.