disruptor BlockingWaitStrategy eat up cpu

277 views
Skip to first unread message

eagle_pan

unread,
Jul 21, 2014, 10:14:40 PM7/21/14
to lmax-di...@googlegroups.com
when i use storm(it use disruptor),I find a process eat up cpu, i use cgroup to bind 2 core
I use jstack to find which thread use more cpu. i find
"Thread-40" prio=10 tid=0x00007fb534c2d000 nid=0x27129 waiting on condition [0x000000004632a000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for <0x0000000756c6ff30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2116)
        at com.lmax.disruptor.BlockingWaitStrategy.waitFor(BlockingWaitStrategy.java:87)
        at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:54)
        at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:56)
        at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:62)
        at backtype.storm.daemon.executor$fn__4384$fn__4393$fn__4440.invoke(executor.clj:658)
        at backtype.storm.util$async_loop$fn__469.invoke(util.clj:396)
        at clojure.lang.AFn.run(AFn.java:24)
        at java.lang.Thread.run(Thread.java:662)

I check storm use strategy, it use BlockingWaitStrategy .
I see some info, it says, if use blockingWaitStrategy, it use no cpu while idle.
so ,i so confused.who know it?

Michael Barker

unread,
Jul 21, 2014, 10:25:54 PM7/21/14
to lmax-di...@googlegroups.com
I'm not sure that you have found the correct thread that is eating CPU.  If you look at the thread state:

java.lang.Thread.State: TIMED_WAITING (parking)

It should be parked by the OS.  However, it is worth noting that Storm is using a very old version of the Disruptor which has some other pathological failure cases, which is could be running into.  Could you post a full stack trace.

Mike.


--
You received this message because you are subscribed to the Google Groups "Disruptor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmax-disrupto...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eagle_pan

unread,
Jul 21, 2014, 10:44:31 PM7/21/14
to lmax-di...@googlegroups.com
first i use top -Hp 159725 -d 1 -n 1 to find out which thread use more cpu
then i print "%x\n" get thread id
then find this thread

在 2014年7月22日星期二UTC+8上午10时14分40秒,eagle_pan写道:

Michael Barker

unread,
Jul 21, 2014, 10:46:20 PM7/21/14
to lmax-di...@googlegroups.com
I think attaching a profiler, e.g. VisualVM or YourKit might give more useful information.


--

eagle_pan

unread,
Jul 21, 2014, 11:13:47 PM7/21/14
to lmax-di...@googlegroups.com
I cannot use this tools,on product environment

在 2014年7月22日星期二UTC+8上午10时14分40秒,eagle_pan写道:

Michael Barker

unread,
Jul 21, 2014, 11:33:20 PM7/21/14
to lmax-di...@googlegroups.com
I would look to replicate the load in a test environment so that you can take a deeper look.  Also take a full stack trace and look for threads in a running state.

Note that Storm uses Disruptor 2.10.1, which is very old.  You should probably talk to the Storm developers and encourage them to upgrade.

Mike.


--

eagle_pan

unread,
Jul 22, 2014, 2:07:41 AM7/22/14
to lmax-di...@googlegroups.com
yeah, i will replicate this case in a test environment

在 2014年7月22日星期二UTC+8上午11时33分20秒,mikeb01写道:
Reply all
Reply to author
Forward
0 new messages