垃圾收集期间负载均衡器和 Tomcat 之间出现 SocketException
我们注意到以下问题:每当我们的 Tomcat JVM 执行 Full GC 时,在 LB 和 Tomcat 之间创建连接的请求都会失败。这是非常有问题的,因为所有这些请求将永远没有机会到达应用程序服务器。
即使我们将一个 Tomcat 指向另一个 Tomcat 且中间没有任何 LB,也会出现此问题。
是否有任何可以在 JVM / Tomcat / Linux 中完成的定义,使 HTTP 连接等待 GC 结束并且应用程序 JVM 将收到请求的时间。
我们使用 Java6、Tomcat7 和 Linux Ubuntu 操作系统。
谢谢, 约西
We have noticed the following problem: whenever our Tomcat JVM performs full GC, the requests to create a connection between the LB ant the Tomcat are failed. This is very problematic since all these requests will never get the chance to arrive to the application server.
This problem occured even when we have pointed one Tomcat to the other without any LB in between.
Are there any definition that can be done in the JVM / Tomcat / Linux that will make the HTTP connection to wait the time till the GC ends and the application JVM will receive the request.
We are using Java6, Tomcat7, and Linux Ubuntu OS.
Thanks,
Yosi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否考虑过使用“XX:+UseConcMarkSweepGC”选项来使用并发垃圾收集器?这本质上是在后台执行垃圾收集,这样就不会出现那么多(如果有的话)“停止世界”的完整 GC。
Have you looked into using the concurrent garbage collector using the 'XX:+UseConcMarkSweepGC' option? This essentially performs garbage collection in the background so that there aren't nearly as many (if any) "stop the world" full GCs.
您可能需要启用并发垃圾收集,如 http:// www.oracle.com/technetwork/java/gc-tuning-5-138395.html
还可以尝试其他 GC 配置。
You may need to enable concurrent garbage collection as described in http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html
Also try other GC configs.