Jetty - 短时间内阻止 http 请求(最多 12 秒)
我使用 Jetty 7.3.1 作为 ubuntu 服务器上的 webContainer。我的网络负载很重,有 300 个用户在线,有很多 ajax。我的问题是,jetty 每隔 1-2 分钟就会停止接受 http 请求,而这些请求正在等待,大部分时间长达 12 秒,然后才被处理。我怎样才能知道发生了什么事???我可以以某种方式跟踪日志吗?我如何发现jetty在那12秒内没有重新启动。也许配置有一些错误,jetty 正在尝试重新启动来修复它。我怎样才能知道发生了什么事?谢谢你的任何想法。
我的内存足够,CPU 负载也很好。
这是我的 jetty.xml 的配置片段:
<Set name="ThreadPool">
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<Set name="minThreads">50</Set>
<Set name="maxThreads">600</Set>
<Set name="detailedDump">false</Set>
</New>
</Set>
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="80"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">5000</Set>
<Set name="lowResourcesMaxIdleTime">2000</Set>
<Set name="useDirectBuffers">false</Set>
</New>
</Arg>
</Call>
I am using Jetty 7.3.1 as my webContainer on ubuntu server. I have there heavy loaded web, 300 users online, with a lot of ajax. My problem is, that every 1-2 minutes jetty stops to accept http requests, and those requests are waiting, mostly up to 12 seconds and than are processed. How can I find out what is going on??? Can I track logs somehow? How do I find that jetty is not restarting in that 12 seconds. Maybe there is something very wrong configured and jetty is trying to restart to fix it. How can I find out what is going on? Thanks for any idea.
I have enough of memory and CPU load is fine.
Here is my config snipet from jetty.xml:
<Set name="ThreadPool">
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<Set name="minThreads">50</Set>
<Set name="maxThreads">600</Set>
<Set name="detailedDump">false</Set>
</New>
</Set>
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="80"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">5000</Set>
<Set name="lowResourcesMaxIdleTime">2000</Set>
<Set name="useDirectBuffers">false</Set>
</New>
</Arg>
</Call>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您向进程发送退出信号(“kill -SIGQUIT PID”),它会将所有线程的堆栈转储到标准输出。也许它会让您了解服务器实际在做什么。
If you send the process a QUIT signal ("kill -SIGQUIT PID"), it will make a stack dump of all threads to stdout. Perhaps it will give you an indication on what the server is actually doing.
您可能有足够的内存,但这并不意味着它被有效地使用和释放。我的第一个怀疑是发生了“stop the world”垃圾收集,或者 CMS 故障。您可能想要分析垃圾收集。
第二个嫌疑人可能是某种同步问题,即多个线程都堆积起来等待同一资源。同样,分析可以帮助您找到这一点。这可能就是您在 JRebel 中看到的。
You may have enough memory, but that doesn't mean it's being used and released efficiently. My first suspect would be a "stop the world" garbage collection, or CMS failure, occurring. You may want to profile garbage collection.
The second suspect would be some sort of a synchronization issue, where multiple threads all pile up waiting for the same resource. Again, profiling may help you find this. This may be what you are seeing in JRebel.