Websphere:本地计算机上的Web服务调用挂起

时间:2013-07-30 08:45:32

标签: sockets service web websphere hang

我在同一个应用服务器IBM Websphere 7.0上部署了两个J2EE应用程序A1和A2。两个应用程序都部署在同一个配置文件中每个应用程序都有自己的Web GUI并提供多个Web服务,例如A1提供S1,A2提供S2。

在正常工作过程中,有几个用户正在使用GUI,而另一个外部系统正在调用Web服务S1和S2。

Web服务S1在他的工作中也称为Web服务S2。

有时,每周大约有一次应用程序服务器挂起。用户无法进入GUI,而其他系统无法访问Web服务。

线程转储显示许多线程在从套接字读取期间正在等待。所有这些线程都是本地Web服务调用。同时在Web容器池中有大约5个空闲线程。总CPU负载小于10%。内存使用情况也没问题。垃圾收集器未运行,当GC运行时大约需要200毫秒,因此GC不是挂起的原因。

所以我的问题是:

  1. 为什么本地网络服务电话会挂起?
  2. 为什么用户在Web容器池中有少量空闲线程时无法访问Web GUI?
  3. =====

    Web容器线程:

    WebContainer : 0    Runnable    3836    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 1    Runnable    3840    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 10   Runnable    1352    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 11   Waiting on condition    1736    java/lang/StackTraceElement.appendTo(StackTraceElement.java:180(Compiled Code)) 74
    WebContainer : 12   Waiting on condition    3444    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 13   Runnable    3056    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 14   Runnable    3508    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 15   Runnable    3344    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 16   Runnable    1592    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 17   Waiting on condition    1744    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 18   Waiting on condition    2108    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 19   Runnable    684 java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 2    Runnable    1552    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 20   Runnable    4824    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 21   Runnable    4132    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 22   Runnable    4116    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 23   Runnable    4164    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 24   Runnable    2668    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 25   Runnable    4212    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 26   Runnable    4020    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 27   Runnable    496 java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 28   Runnable    2448    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 29   Runnable    3428    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 3    Runnable    3908    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 30   Runnable    4168    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 31   Runnable    4160    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 32   Runnable    3328    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 33   Runnable    3348    java/net/SocketInputStream.socketRead0(Native Method)   69
    WebContainer : 34   Runnable    3324    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 35   Runnable    4308    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 36   Blocked 3164    java/lang/Object.wait(Native Method)    6
    WebContainer : 37   Blocked 852 java/lang/Object.wait(Native Method)    6
    WebContainer : 38   Waiting on condition    4288    java/lang/Object.wait(Native Method)    6
    WebContainer : 39   Blocked 5056    java/lang/Object.wait(Native Method)    6
    WebContainer : 4    Runnable    2400    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 5    Runnable    4092    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 6    Runnable    3968    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 7    Runnable    1832    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 8    Waiting on condition    3356    java/net/SocketInputStream.socketRead0(Native Method)   68
    WebContainer : 9    Runnable    2236    java/net/SocketInputStream.socketRead0(Native Method)   68
    

    =====

    主题36-39是免费的:

    at java/lang/Object.wait(Native Method) 
    at java/lang/Object.wait(Object.java:196(Compiled Code)) 
    at com/ibm/ws/util/BoundedBuffer.waitGet_(BoundedBuffer.java:187(Compiled Code)) 
    at com/ibm/ws/util/BoundedBuffer.take(BoundedBuffer.java:549(Compiled Code)) 
    at com/ibm/ws/util/ThreadPool.getTask(ThreadPool.java:899(Compiled Code)) 
    at com/ibm/ws/util/ThreadPool$Worker.run(ThreadPool.java:1653(Compiled Code)) 
    

    =====

    几乎所有其余线程都具有相同的堆栈跟踪:

    at java/net/SocketInputStream.socketRead0(Native Method) 
    at java/net/SocketInputStream.read(SocketInputStream.java:140(Compiled Code)) 
    at java/io/BufferedInputStream.fill(BufferedInputStream.java:229(Compiled Code)) 
    at java/io/BufferedInputStream.read(BufferedInputStream.java:248(Compiled Code)) 
    at org/apache/axis/transport/http/HTTPSender.readHeadersFromSocket(HTTPSender.java:583(Compiled Code)) 
    at org/apache/axis/transport/http/HTTPSender.invoke(HTTPSender.java:143(Compiled Code)) 
    at org/apache/axis/strategies/InvocationStrategy.visit(InvocationStrategy.java:32(Compiled Code)) 
    at org/apache/axis/SimpleChain.doVisiting(SimpleChain.java:118(Compiled Code)) 
    at org/apache/axis/SimpleChain.invoke(SimpleChain.java:83(Compiled Code)) 
    at org/apache/axis/client/AxisClient.invoke(AxisClient.java:165(Compiled Code)) 
    at org/apache/axis/client/Call.invokeEngine(Call.java:2784(Compiled Code)) 
    at org/apache/axis/client/Call.invoke(Call.java:2767(Compiled Code)) 
    at org/apache/axis/client/Call.invoke(Call.java:2443(Compiled Code)) 
    at org/apache/axis/client/Call.invoke(Call.java:2366(Compiled Code)) 
    at org/apache/axis/client/Call.invoke(Call.java:1812(Compiled Code)) 
    
    call web service S2 on the same host here
    ...
    My web service code here.
    ...
    at sun/reflect/GeneratedMethodAccessor366.invoke(Bytecode PC:124(Compiled Code)) 
    at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37(Compiled Code)) 
    at java/lang/reflect/Method.invoke(Method.java:611(Compiled Code)) 
    at org/apache/axis/providers/java/RPCProvider.invokeMethod(RPCProvider.java:397(Compiled Code)) 
    at org/apache/axis/providers/java/EJBProvider.invokeMethod(EJBProvider.java:459(Compiled Code)) 
    at org/apache/axis/providers/java/RPCProvider.processMessage(RPCProvider.java:186(Compiled Code)) 
    at org/apache/axis/providers/java/JavaProvider.invoke(JavaProvider.java:323(Compiled Code)) 
    at org/apache/axis/strategies/InvocationStrategy.visit(InvocationStrategy.java:32(Compiled Code)) 
    at org/apache/axis/SimpleChain.doVisiting(SimpleChain.java:118(Compiled Code)) 
    at org/apache/axis/SimpleChain.invoke(SimpleChain.java:83(Compiled Code)) 
    at org/apache/axis/handlers/soap/SOAPService.invoke(SOAPService.java:454(Compiled Code)) 
    at org/apache/axis/server/AxisServer.invoke(AxisServer.java:281(Compiled Code)) 
    at org/apache/axis/transport/http/AxisServlet.doPost(AxisServlet.java:699(Compiled Code)) 
    at javax/servlet/http/HttpServlet.service(HttpServlet.java:738(Compiled Code)) 
    at org/apache/axis/transport/http/AxisServletBase.service(AxisServletBase.java:327(Compiled Code)) 
    at javax/servlet/http/HttpServlet.service(HttpServlet.java:831(Compiled Code)) 
    at com/ibm/ws/webcontainer/servlet/ServletWrapper.service(ServletWrapper.java:1657(Compiled Code)) 
    at com/ibm/ws/webcontainer/servlet/ServletWrapper.service(ServletWrapper.java:1597(Compiled Code)) 
    at com/ibm/ws/webcontainer/filter/WebAppFilterChain.doFilter(WebAppFilterChain.java:131(Compiled Code)) 
    
    at com/ibm/ws/webcontainer/filter/FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188(Compiled Code)) 
    at com/ibm/ws/webcontainer/filter/WebAppFilterChain.doFilter(WebAppFilterChain.java:116(Compiled Code)) 
    at com/ibm/ws/webcontainer/filter/WebAppFilterChain._doFilter(WebAppFilterChain.java:77(Compiled Code)) 
    at com/ibm/ws/webcontainer/filter/WebAppFilterManager.doFilter(WebAppFilterManager.java:908(Compiled Code)) 
    at com/ibm/ws/webcontainer/servlet/ServletWrapper.handleRequest(ServletWrapper.java:934(Compiled Code)) 
    at com/ibm/ws/webcontainer/servlet/ServletWrapper.handleRequest(ServletWrapper.java:502(Compiled Code)) 
    at com/ibm/ws/webcontainer/servlet/ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181(Compiled Code)) 
    at com/ibm/ws/webcontainer/servlet/CacheServletWrapper.handleRequest(CacheServletWrapper.java:91(Compiled Code)) 
    at com/ibm/ws/webcontainer/WebContainer.handleRequest(WebContainer.java:864(Compiled Code)) 
    at com/ibm/ws/webcontainer/WSWebContainer.handleRequest(WSWebContainer.java:1592(Compiled Code)) 
    at com/ibm/ws/webcontainer/channel/WCChannelLink.ready(WCChannelLink.java:186(Compiled Code)) 
    at com/ibm/ws/http/channel/inbound/impl/HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452(Compiled Code)) 
    at com/ibm/ws/http/channel/inbound/impl/HttpInboundLink.handleNewRequest(HttpInboundLink.java:511(Compiled Code)) 
    at com/ibm/ws/http/channel/inbound/impl/HttpInboundLink.processRequest(HttpInboundLink.java:305(Compiled Code)) 
    at com/ibm/ws/http/channel/inbound/impl/HttpInboundLink.ready(HttpInboundLink.java:276(Compiled Code)) 
    at com/ibm/ws/tcp/channel/impl/NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214(Compiled Code)) 
    at com/ibm/ws/tcp/channel/impl/NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113(Compiled Code)) 
    at com/ibm/ws/tcp/channel/impl/AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165(Compiled Code)) 
    at com/ibm/io/async/AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217(Compiled Code)) 
    at com/ibm/io/async/AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161(Compiled Code)) 
    at com/ibm/io/async/AsyncFuture.completed(AsyncFuture.java:138(Compiled Code)) 
    at com/ibm/io/async/ResultHandler.complete(ResultHandler.java:204(Compiled Code)) 
    at com/ibm/io/async/ResultHandler.runEventProcessingLoop(ResultHandler.java:775(Compiled Code)) 
    at com/ibm/io/async/ResultHandler$2.run(ResultHandler.java:905(Compiled Code)) 
    at com/ibm/ws/util/ThreadPool$Worker.run(ThreadPool.java:1646(Compiled Code)) 
    

    感谢。

    斯坦

1 个答案:

答案 0 :(得分:0)

似乎所有线程都被锁定等待某事。通常在这种情况下,超时应该打破锁定;如果没有发生:

  • 配置超时中的某处设置为0(无限)
  • 应用程序逻辑会产生一种乘数效应。示例:查询需要很长时间,用户再次提交需要更多的查询并锁定其他Web线程,异常会触发Web服务调用,等等。

在DB端,是否有死锁?