You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@omid.apache.org by "larsh@apache.org" <la...@apache.org> on 2018/12/26 09:54:25 UTC

Omid is busy-waiting?

I'm running Omid via its Phoenix integration.
After building 1.1.0-SNAPSHOT from source and starting Omid I find that it consumes 400% CPU (i.e. 4 cores) just being idle.

Indeed with jstack I find four thread like this (which may or may not be related):

"persist-0" #64 prio=5 os_prio=0 tid=0x00007f045c3a5800 nid=0x3745 runnable [0x00007f043dedf000]
   java.lang.Thread.State: RUNNABLE
        at com.lmax.disruptor.BusySpinWaitStrategy.waitFor(BusySpinWaitStrategy.java:36)
        at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:56)
        at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:148)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Am I the only one seeing this?

Thanks.

-- Lars

Re: Omid is busy-waiting?

Posted by "larsh@apache.org" <la...@apache.org>.
 Thanks Yoni,
that makes sense, lemme try that.(I'd say that busy waiting is a "bad" default.)

-- Lars

    On Wednesday, December 26, 2018, 2:58:16 AM PST, Yoni Gottesman <yo...@apache.org> wrote:  
 
 Hi, you are right. The default setting for omid is to run in HIGH_THROUGHPUT mode. This means that the threads in the disruptor are busy-waiting.If you want omid to run in a blocking mode, add to bin/omid-server-configuration.yml:waitStrategy: LOW_CPUDoes this make sense?

On Wed, Dec 26, 2018 at 11:54 AM larsh@apache.org <la...@apache.org> wrote:

I'm running Omid via its Phoenix integration.
After building 1.1.0-SNAPSHOT from source and starting Omid I find that it consumes 400% CPU (i.e. 4 cores) just being idle.

Indeed with jstack I find four thread like this (which may or may not be related):

"persist-0" #64 prio=5 os_prio=0 tid=0x00007f045c3a5800 nid=0x3745 runnable [0x00007f043dedf000]
   java.lang.Thread.State: RUNNABLE
        at com.lmax.disruptor.BusySpinWaitStrategy.waitFor(BusySpinWaitStrategy.java:36)
        at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:56)
        at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:148)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Am I the only one seeing this?

Thanks.

-- Lars

  

Re: Omid is busy-waiting?

Posted by Yoni Gottesman <yo...@apache.org>.
Hi, you are right. The default setting for omid is to run in
HIGH_THROUGHPUT mode. This means that the threads in the disruptor
<https://lmax-exchange.github.io/disruptor/>are busy-waiting.
If you want omid to run in a blocking mode, add to
bin/omid-server-configuration.yml:
waitStrategy: LOW_CPU
Does this make sense?

On Wed, Dec 26, 2018 at 11:54 AM larsh@apache.org <la...@apache.org> wrote:

> I'm running Omid via its Phoenix integration.
> After building 1.1.0-SNAPSHOT from source and starting Omid I find that it
> consumes 400% CPU (i.e. 4 cores) just being idle.
>
> Indeed with jstack I find four thread like this (which may or may not be
> related):
>
> "persist-0" #64 prio=5 os_prio=0 tid=0x00007f045c3a5800 nid=0x3745
> runnable [0x00007f043dedf000]
>    java.lang.Thread.State: RUNNABLE
>         at
> com.lmax.disruptor.BusySpinWaitStrategy.waitFor(BusySpinWaitStrategy.java:36)
>         at
> com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:56)
>         at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:148)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
>
> Am I the only one seeing this?
>
> Thanks.
>
> -- Lars
>