2

最近我们在 JBoss 7.1.1Final 上部署了 J2EE 应用程序。此应用程序使用 CDI(焊接实现)、JSF 2.1 (Mojarra)、Seam 3 和 Hibernate 4。当我们遇到更高的负载时,应用程序会变慢。即使在负载下降一点之后,响应能力仍然较差。在 8 核机器上 CPU 利用率约为 300%。所以看起来CPU不是瓶颈。我还检查了数据库或 IO 是否可能是瓶颈,但事实并非如此。还有足够的内存,JVM 在提供的 3GB 中最多使用 2GB。我真的不知道还能去哪里看。当服务器具有高 CPU 利用率时,我转储了使用 CPU 最多的线程,似乎 Weld 或 JSF 存在一些问题,以下是响应性较低时经常发生的一些线程转储:

 java.lang.Thread.State: RUNNABLE
    at java.lang.ThreadLocal.get(ThreadLocal.java:143)
    at org.jboss.weld.context.cache.RequestScopedBeanCache.isActive(RequestScopedBeanCache.java:37)
    at org.jboss.seam.faces.environment.SeamExternalContext$Proxy$_$$_WeldClientProxy.getInitParameter(SeamExternalContext$Proxy$_$$_WeldClientProxy.java)
    at javax.faces.component.UIComponent.popComponentFromEL(UIComponent.java:1944)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2218)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1883)
    at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:400)
    at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2635)
    at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2607)
    at com.sun.faces.facelets.tag.jsf.ComponentSupport.addComponent(ComponentSupport.java:574)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.addComponentToView(ComponentTagHandlerDelegateImpl.java:311)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:211)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
    at com.sun.faces.facelets.tag.ui.DecorateHandler.apply(DecorateHandler.java:145)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:195)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)


 java.lang.Thread.State: RUNNABLE
    at java.lang.Thread.currentThread(Native Method)
    at java.lang.ThreadLocal.get(ThreadLocal.java:143)
    at org.jboss.weld.bean.proxy.InterceptionDecorationContext.pop(InterceptionDecorationContext.java:43)
    at org.jboss.weld.bean.proxy.InterceptionDecorationContext.endInterceptorContext(InterceptionDecorationContext.java:93)
    at org.jboss.seam.faces.environment.SeamExternalContext$Proxy$_$$_WeldClientProxy.getInitParameter(SeamExternalContext$Proxy$_$$_WeldClientProxy.java)
    at javax.faces.component.UIComponent.pushComponentToEL(UIComponent.java:1860)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2200)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
    at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1883)
    at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:400)
    at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2635)
    at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2607)
    at com.sun.faces.facelets.tag.jsf.ComponentSupport.addComponent(ComponentSupport.java:574)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.addComponentToView(ComponentTagHandlerDelegateImpl.java:311)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:211)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:195)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
    at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
    at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
    at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
    at org.richfaces.view.facelets.html.BehaviorsAddingComponentHandlerWrapper.applyNextHandler(BehaviorsAddingComponentHandlerWrapper.java:53)
    at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:195)
    at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:182)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
    at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
    at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)

   java.lang.Thread.State: RUNNABLE
at java.lang.ThreadLocal$ThreadLocalMap$Entry.<init>(ThreadLocal.java:276)
at java.lang.ThreadLocal$ThreadLocalMap.set(ThreadLocal.java:443)
at java.lang.ThreadLocal$ThreadLocalMap.access$100(ThreadLocal.java:261)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:164)
at java.lang.ThreadLocal.get(ThreadLocal.java:150)
at org.jboss.weld.bean.proxy.InterceptionDecorationContext.push(InterceptionDecorationContext.java:58)
at org.jboss.weld.bean.proxy.InterceptionDecorationContext.startInterceptorContext(InterceptionDecorationContext.java:97)
at org.jboss.seam.faces.environment.SeamExternalContext$Proxy$_$$_WeldClientProxy.getInitParameter(SeamExternalContext$Proxy$_$$_WeldClientProxy.java)
at javax.faces.component.UIComponent.pushComponentToEL(UIComponent.java:1860)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2200)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2206)
at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1883)
at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:400)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2635)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2607)
at com.sun.faces.facelets.tag.jsf.ComponentSupport.addComponent(ComponentSupport.java:574)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.addComponentToView(ComponentTagHandlerDelegateImpl.java:311)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:211)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:182)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)

任何想法可能是什么问题?

谢谢

4

0 回答 0