2012-02-06 30 views
7

私は生産環境でGlassfish 3.1.1 Webプロファイルを使用していますが、CPUが多すぎます。 サーバー設定は次のとおりです。Windows Server 2008 R2 64ビット、Intel Xeon 8core @ 3,2GHz、8GB RAM。 JDK 1.7u2 64bitを使用しています。 GlassfishのJVM設定:Glassfish - 高いCPU使用量

<jvm-options>-XX:+UseCompressedOops</jvm-options> 
<jvm-options>-Xmn1g</jvm-options> 
<jvm-options>-Xss128k</jvm-options> 
<jvm-options>-XX:+UseParallelOldGC</jvm-options> 
<jvm-options>-XX:ParallelGCThreads=4</jvm-options> 
<jvm-options>-Xmx3g</jvm-options> 
<jvm-options>-XX:+DisableExplicitGC</jvm-options> 
<jvm-options>-d64</jvm-options> 
<jvm-options>-XX:PermSize=256m</jvm-options> 
<jvm-options>-Xms3g</jvm-options> 
<jvm-options>-XX:MaxPermSize=256m</jvm-options> 
<jvm-options>-XX:+AggressiveHeap</jvm-options> 

私は、90%およびアプリケーションdosen'tの応答をGlassfishのは15%〜40%のCPUを使用し、数時間または1日の実行http://jfarcand.wordpress.com/2009/11/27/putting-glassfish-v3-in-production-essential-surviving-guide/ に応じても調整するいくつかのオプションをsometiesました。

[#|2012-02-03T10:30:46.837+0100|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=43;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: http-thread-pool-80(32).|#] 

[#|2012-02-03T10:30:55.074+0100|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=41;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: http-thread-pool-80(41).|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;|java.nio.channels.ClosedChannelException 
    at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249) 
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440) 
    at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:108) 
    at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76) 
    at com.sun.grizzly.http.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:326) 
    at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:398) 
    at com.sun.grizzly.http.SocketChannelOutputBuffer.realWriteBytes(SocketChannelOutputBuffer.java:282) 
    at com.sun.grizzly.tcp.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:898) 
    at com.sun.grizzly.tcp.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:167) 
    at com.sun.grizzly.tcp.http11.filters.GzipOutputFilter$FakeOutputStream.write(GzipOutputFilter.java:223) 
    at java.util.zip.GZIPOutputStream.finish(GZIPOutputStream.java:169) 
    at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238) 
    at com.sun.grizzly.tcp.http11.filters.GzipOutputFilter.recycle(GzipOutputFilter.java:186) 
    at com.sun.grizzly.http.SocketChannelOutputBuffer.recycle(SocketChannelOutputBuffer.java:417) 
    at com.sun.grizzly.http.ProcessorTask.finishResponse(ProcessorTask.java:817) 
    at com.sun.grizzly.http.ProcessorTask.postResponse(ProcessorTask.java:750) 
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:726) 
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019) 
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) 
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) 
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) 
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) 
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) 
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) 
    at java.lang.Thread.run(Thread.java:722) 
|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:249)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:440)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:108)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:326)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:398)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.SocketChannelOutputBuffer.realWriteBytes(SocketChannelOutputBuffer.java:282)|#] 

[#|2012-02-03T10:30:56.665+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.tcp.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:898)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.tcp.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:167)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.tcp.http11.filters.GzipOutputFilter$FakeOutputStream.write(GzipOutputFilter.java:223)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at java.util.zip.GZIPOutputStream.finish(GZIPOutputStream.java:169)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.tcp.http11.filters.GzipOutputFilter.recycle(GzipOutputFilter.java:186)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.SocketChannelOutputBuffer.recycle(SocketChannelOutputBuffer.java:417)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.finishResponse(ProcessorTask.java:817)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.postResponse(ProcessorTask.java:750)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:726)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.ContextTask.run(ContextTask.java:71)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)|#] 

[#|2012-02-03T10:30:56.681+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=138;_ThreadName=Thread-2;| at java.lang.Thread.run(Thread.java:722)|#] 

[#|2012-02-03T10:31:00.440+0100|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=40;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: http-thread-pool-80(38).|#] 

[#|2012-02-03T10:33:49.170+0100|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=40;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: http-thread-pool-80(11).|#] 

[#|2012-02-03T10:33:57.235+0100|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=43;_ThreadName=Thread-2;|GRIZZLY0023: Interrupting idle Thread: http-thread-pool-80(16).|#] 

編集:私はGlassfishのGZIP圧縮にバグがあり、問題を解決したので、私はそれをオフに。 http://www.java.net/forum/topic/glassfish/glassfish/glassfish-301-gzip-problem-threads-apparently-spinning-100-cpu-use

代わりに、私はコンテンツを圧縮するためにhttp://www.servletsuite.com/servlets/gzipflt.htmを使用します。

答えて

0

GZIPを使用していないにもかかわらず、同様の問題がありました。しばらくして(高負荷の下で)私たちのログは、我々はGlassfishの3.1.2.2で見つかったバージョンにグリズリーをアップグレードすることにより、Glassfishの3.1.1のためにこれを解決するために管理

GRIZZLY0023: Interrupting idle Thread: http-thread-pool-28080(34)

でいっぱいでしょう。詳しくはhttp://thumbtribe-it.blogspot.com/2012/10/grizzly0023.html

+0

ええ、私はまた、私のdevマシン上でCPUを食べる動作を得ています。面白いことに、GFインスタンスは負荷がかかっていません。実際には、私はそれがNOのアプリケーションを展開して実行されたままにしておくことができます、そして、それは一定の時間の後にこれを行います(申し訳ありませんが、私はまだそれを時間をかけようとしていません)。このリンクはいくつかのものと関連があります:http://gregorbowie.wordpress.com/2012/05/03/java-glassfish-v3-high-cpu-and-memory-usage-locked-threads-death/ – demaniak

1

これは明らかにGlassFish 3.1.1および3.1.2のバグです。 JIRA issue for itには、役立つかもしれないパッチが含まれています。

0

これは、ビュー内の式によって参照されるJavaコードの無限ループによって引き起こされる可能性があります。 Take a tread dumpが実行されているときにこの問題が発生し、http-thread-pool-80(32)http-thread-pool-80(41)のような問題のあるスレッドを検索する - アプリケーションサーバーがアプリケーションコードの1つのセクションですべての時間を費やしている場合、無限ループ(または、コードが頻繁に実行される原因となる何か)である可能性があります。