wowza java high cpu usage

一曲冷凌霜 提交于 2019-12-24 10:38:59

问题


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)

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

this is my environment.

CentOS release 5.4 (Final)

WowzaMediaServer-3.1.2

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)


回答1:


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)

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.

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




回答2:


I had the same problem, I fixed it with stopping ntp service and set DATE manually and restart ntp service:

        /etc/init.d/ntp stop
        date -s "$(date)"
        /etc/init.d/ntp start


来源:https://stackoverflow.com/questions/13265727/wowza-java-high-cpu-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!