简体   繁体   English

性能-响应时间变慢

[英]Performance — response time slows down

We have a Java EE application(jsp/servlet,jdbc) running on Apache-tomcat server. 我们有一个运行在Apache-tomcat服务器上的Java EE应用程序(jsp / servlet,jdbc)。 The response time slows with time. 响应时间随时间而变慢。 It slows down at faster rate when continuously worked on. 持续工作时,它会以更快的速度减慢速度。

The response time is back to normal after restart of the server. 重新启动服务器后,响应时间恢复正常。

I connected Jconsole to the server and I am attaching the screen shot of the heap memory usage,which goes up when doing intensive work and garbage collector kicks off periodically and the memory usage comes down. 我将Jconsole连接到服务器,并附加了堆内存使用情况的屏幕快照,当执行大量工作且垃圾收集器定期启动并且内存使用率下降时,该屏幕快照将增加。 However, when testing towards the end, despite kicking off garbage collector manually the response time is not going down. 但是,在进行最后测试时,尽管手动启动了垃圾收集器,但响应时间并未减少。 II also checked the connections and they seem to be closing off properly. II还检查了连接,它们似乎已正确关闭。 ie I do not notice any zcx 即我没有注意到任何zcx 堆内存使用情况

Any help is appreciated. 任何帮助表示赞赏。

How much slower are the response times? 响应时间慢了多少? Have you done any profiling or logging to help know which parts of your app are slower? 您是否进行了任何性能分析或日志记录,以帮助您了解应用程序的哪些部分速度较慢? It might be useful to setup a simple servlet to see if that also slows down as the other does. 设置一个简单的servlet来查看它是否也会像其他服务器一样放慢速度,这可能会很有用。 That might tell you if Tomcat or something in your app is slowing down. 这可能会告诉您Tomcat或应用程序中的某些东西是否正在减慢速度。

Did you fine-tune your tomcat memory settings? 您是否已对tomcat的内存设置进行了微调? Perhaps you need to increase perm gen size a bit. 也许您需要稍微增加烫发的大小。 eg -XX:MaxPermSize=512M 例如-XX:MaxPermSize = 512M

You can know it for sure if you can get a heap dump and load it to a tool like MemoryAnalyzer. 您可以肯定地知道它是否可以获取堆转储并将其加载到诸如MemoryAnalyzer之类的工具中。

Attach with jvisualvm in the JDK. 在JDK中附加jvisualvm。 It allows you to profile Tomcat and find where the time goes. 它允许您分析Tomcat并找到时间。

My guess right now is the database connections. 我现在的猜测是数据库连接。 Either they go stale or the pool runs dry. 他们要么变得过时,要么池池干dry。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM