wowza java cpu使用率高 [英] wowza java high cpu usage

查看:118
本文介绍了wowza java cpu使用率高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对wowza中的cpu使用有疑问。

I have problem about cpu usage in wowza.

这是一个令人怀疑的线程。

this is doubtful thread. this thread is took high cpu.

SocketAcceptorIoProcessor-1.0 prio=10 tid=0x0000002a9fb53000 nid=0x2428 runnable         [0x000000004f017000]
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:210)
at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
- locked <0x00000007d82ba4e8> (a sun.nio.ch.Util$2)
- locked <0x00000007d82ba4d8> (a java.util.Collections$UnmodifiableSet)
- locked <0x00000007d82ad450> (a sun.nio.ch.EPollSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

此线程的CPU使用率很高。这是jdk错误吗?

this thread took high cpu. is this jdk bug or else?

这是我的环境。

CentOS版本5.4(最终版)

CentOS release 5.4 (Final)

WowzaMediaServer-3.1.2

WowzaMediaServer-3.1.2

java版本1.6.0_23
Java(TM)SE运行时环境(内部版本1.6.0_23-b05)
Java HotSpot(TM)64位服务器VM(内部版本19.0-b09,混合模式)

java version 1.6.0_23 Java(TM) SE Runtime Environment (build 1.6.0_23-b05) Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

推荐答案

我首先要检查它是否确实在消耗CPU。如果要对应用程序进行性能分析,则在该方法实际上处于阻塞状态时,它似乎在此方法上花费了很多时间。大多数分析器都难以分辨出一种方法,即在本机代码中分配时间(消耗大量CPU)和一种在阻塞中(消耗很少的CPU)之间的区别

I would first check it really is consuming CPU. If you are profiling the application it can appear to be spending allot of time in this method, when the method is actually blocking. Most profilers have problems telling the difference between a method which is spending allot of time in native code (consumes lots of CPU) and one which is blocking (consumes very little CPU)

较旧的Java版本具有可能导致选择器旋转的错误。也就是说,即使在其他情况下它仍然可以正常运行,它也会在不阻塞繁忙循环的情况下不返回任何选择器。我相信较新版本的Java已解决此问题。我会尝试使用Java 6 update 35或Java 7 update 7来解决问题。

Older versions of Java had bugs which could result in the selector spinning. i.e. it keeps returning no selectors without blocking in a busy loop even though it still functions correctly otherwise. I believe newer version of Java have this fixed. I would try Java 6 update 35 or Java 7 update 7 to see if it fixes your problem.

如果连接数少于几百个,我宁愿使用阻塞NIO因为它更简单,恕我直言。

I prefer to use blocking NIO if there is less than a few hundred connections as it much simpler IMHO.

这篇关于wowza java cpu使用率高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆