我们在 jetty 9.0.3 服务器上部署了一个应用程序 REST 网关。部署在 jetty 中的服务的身份验证和授权由 apache commons-httpclient3.1 负责。 当有大量并发线程访问 Rest 网关时,大量 CLOSE_WAIT 堆积在 REST 网关机器中。 通过调用 apache commons 的 releaseConnections 方法正确关闭为向启用程序(结束点)发送请求而打开的 Http 连接。 请让我知道如何处理这些 CLOSE_WAIT 或连接以 CLOSE_WAIT 结束的任何线索。
最佳答案
当 Apache commons http Client 3.1 提供的 closeIdleConnections(0) 时,close_wait 连接消失了。但是现在建立了太多的 TIME_WAIT 并且后端我收到诸如“地址已在使用”之类的错误:(
最后,在使用 closeIdleConnections(0) 后没有看到 CLOSE_WAIT 连接。希望这个解决方案可以帮助其他人:)
关于java - jetty 9.0.3 中的 Close_wait 过多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23644090/