简体   繁体   English

Jboss应用程序性能不佳

[英]Jboss application poor performance

I have an application running in Jboss 5.1 and its having performance issue every other week and we have to restart the application to bring it back to normal. 我有一个在Jboss 5.1中运行的应用程序,每隔一周就会遇到性能问题,我们必须重新启动该应用程序以使其恢复正常。 The above graph is captured when application is running at peak hour's .I'm trying to understand is there a room for improvement from application perspective before looking at the other areas (like infrastructure and network) 上图是在高峰时段运行应用程序时捕获的。我试图了解在查看其他方面(例如基础架构和网络)之前,从应用程序角度来看还有改进的余地

Graph generated through jvisualvm which shows heap usage 通过jvisualvm生成的图显示了堆的使用情况

Here is the heap size settings I have got for this application 这是我为此应用程序获得的堆大小设置

JAVA_OPTS="${JAVA_OPTS} -Xms3072m -Xmx6144m -XX:PermSize=512m -XX:MaxPermSize=2048m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.lang.ClassLoader.allowArraySyntax=true "
JAVA_OPTS="$JAVA_OPTS -verbose: gc -Xloggc:/test/log/gc.log -XX: +PrintGCDetails -XX:+PrintGCDateStamps"
  1. Why, from graph, the application is using only 3G of memory even though I have given 6G as max memory? 为什么从图形上看,即使我给了6G作为最大内存,应用程序也只使用3G内存?
  2. Is my GC settings correct? 我的GC设置正确吗? I may have copied from a different server, how do I make sure I have right GC setting for this application? 我可能是从其他服务器复制过来的,如何确保我对该应用程序具有正确的GC设置?
  3. Is GC happening too frequently, if I remove time interval from settings how would it determine when GC has to run? 如果我从设置中删除了时间间隔,GC发生得是否太频繁了,它将如何确定何时必须运行GC?
  4. I took heap dump last time when we had to restart application and loaded it in jvisualvm but I don't know what to look for in heap dump(I'm not a developer) Can someone tell what to look for in heap dump and how to improve it 我上次必须重新启动应用程序并将其加载到jvisualvm中时进行了堆转储,但我不知道在堆转储中要查找什么(我不是开发人员)有人可以告诉我在堆转储中寻找什么以及如何改善它
  5. Is there anything else we can do to improve application performance from what we see in the graph and GC settings 我们还可以通过图表和GC设置看到什么来提高应用程序性能?

Here are your points answered to my best ability: 以下是您对我最大能力的回答:

  1. For the time being, your app is happy with 3GB of heap and does not need to increase it. 暂时,您的应用程序对3GB的堆感到满意,不需要增加它。 Presumably it does so as it goes along, before failing every other week. 大概每隔一周就会失败。
  2. GC performance tuning is the answer. GC性能调整是答案。 You need to monitor and adjust, only when you know, what you adjusting. 仅当您知道调整内容时,才需要监视和调整。 Then measure, log. 然后测量,记录。 Rinse and repeat. 冲洗并重复。
  3. It will run GC when it needs to (when its Young Generation is running out of space). 它会在需要时(当它的年轻一代空间用完时)运行GC。 It measures many things and takes various settings into consideration to decide, when to GC. 它测量很多东西并考虑各种设置来决定何时进行GC。 It will happen without any assistance, but you can tell it a bit more of the global picture, which GC is trying to establish in order to tune itself. 它会在没有任何帮助的情况下发生,但是您可以告诉它更多的全局信息,GC正在尝试建立全局信息以进行自我调整。
  4. You can slice and dice it in many ways. 您可以通过多种方式对其进行切片和切块。 This amount of information yield many views. 这种信息量产生了很多观点。 You can look at which classes using most memory, which could indicate where the problem lies (I presume a memory leak or some other system resource like file handle not being freed). 您可以查看哪些类使用了最多的内存,这可能表明问题出在哪里(我认为内存泄漏或某些其他系统资源(如文件句柄)未释放)。 See here for basic use of VisualVM 有关VisualVM的基本用法,请参见此处
  5. You need to know, what causes the problem. 您需要知道导致问题的原因。 Usually the best thing to do is fix the faulty app, rather than shifting the burden to GC. 通常,最好的办法是修复有故障的应用程序,而不是将负担转移给GC。 If you have a resource leak, it will hit you sooner or later anyway. 如果您有资源泄漏,无论如何迟早都会打击您。

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

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