very slow consumer cpu 100%

View: New views
9 Messages — Rating Filter:   Alert me  

very slow consumer cpu 100%

by shital :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i have application where JMS server sends me like couple of messages per second and i have consumer which is very slow. and eventually cpu usage becomes 100% on consumer's machine. I am using Topic n ot queues. i have set the prefecth size to 1 on consumer machine. what can i do to control messages.

my JMS server is fine and its dropping messages if client can not keep up, thats fine as these are stock prices. but how can i control cpu usage on consumer's machine

Thanks
Shital

Re: very slow consumer cpu 100%

by James.Strachan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've never seen this before. Could you try run your application in a
profiler to see where the CPU is being spent?

On 8/1/06, shital <shitalbpatel@...> wrote:

>
> i have application where JMS server sends me like couple of messages per
> second and i have consumer which is very slow. and eventually cpu usage
> becomes 100% on consumer's machine. I am using Topic n ot queues. i have set
> the prefecth size to 1 on consumer machine. what can i do to control
> messages.
>
> my JMS server is fine and its dropping messages if client can not keep up,
> thats fine as these are stock prices. but how can i control cpu usage on
> consumer's machine
>
> Thanks
> Shital
> --
> View this message in context: http://www.nabble.com/very-slow-consumer-cpu-100--tf2034246.html#a5596704
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: very slow consumer cpu 100%

by shital :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i already did this. i used netbean's profiler. the main thing is server is sending at such high rate that client can not keep up. also on the client hand i am trying to update the JTable with whatever data i get.

to update the table i am using SwingUtilities.invokelater(..) . if i just read messages and dont do anything then its looks like fine. but if i process the message then CPU raises ??

any idea ?
Thanks
Shital

Re: very slow consumer cpu 100%

by James.Strachan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maybe your consumer can't deal with the high rate of messages its receiving?

On 8/1/06, shital <shitalbpatel@...> wrote:

>
> i already did this. i used netbean's profiler. the main thing is server is
> sending at such high rate that client can not keep up. also on the client
> hand i am trying to update the JTable with whatever data i get.
>
> to update the table i am using SwingUtilities.invokelater(..) . if i just
> read messages and dont do anything then its looks like fine. but if i
> process the message then CPU raises ??
>
> any idea ?
> Thanks
> Shital
> --
> View this message in context: http://www.nabble.com/very-slow-consumer-cpu-100--tf2034246.html#a5597125
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: very slow consumer cpu 100%

by Hiram Chirino :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HI shital, then build in delays in procesing the message on the consumer
side.  i.e. after you call invokelater, do a sleep.

On 8/1/06, shital <shitalbpatel@...> wrote:

>
>
> i already did this. i used netbean's profiler. the main thing is server is
> sending at such high rate that client can not keep up. also on the client
> hand i am trying to update the JTable with whatever data i get.
>
> to update the table i am using SwingUtilities.invokelater(..) . if i just
> read messages and dont do anything then its looks like fine. but if i
> process the message then CPU raises ??
>
> any idea ?
> Thanks
> Shital
> --
> View this message in context:
> http://www.nabble.com/very-slow-consumer-cpu-100--tf2034246.html#a5597125
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--
Regards,
Hiram

Blog: http://hiramchirino.com

Re: very slow consumer cpu 100%

by shital :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yes i think my consumer can not keep up. but what can i do to control cpu usage ?
I will try this sleep(..) idea and see whats happen ?

Thanks for helping..
Shital

Re: very slow consumer cpu 100%

by shital :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i tried sleep(..) but that is not helping me, the main thing is rate is so high that if i put delay then i can not see Table updating.

any other idea ?

Thanks
Shital

Re: very slow consumer cpu 100%

by James.Strachan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/1/06, shital <shitalbpatel@...> wrote:
>
> i tried sleep(..) but that is not helping me, the main thing is rate is so
> high that if i put delay then i can not see Table updating.

Just throttle the rates via sleeping; so you only actually update the
table a few times a second for low CPU boxes and allow the throttle
rate to be larger for faser boxes. Given the rate and the fact that
you are writing a rich client, why is high CPU usage such a concern?

--

James
-------
http://radio.weblogs.com/0112098/

Re: very slow consumer cpu 100%

by Matt Vincent :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have the same problem.  The CPU is maxed out.

Launch through Spring (with org.apache.activemq.xbean.BrokerFactoryBean) and CPU is 100%
Launch same config through command line (./bin/activemq xbean:../conf/my-activemq.xml) and CPU is fine (very low)

I've tried this and received the same results for both AMQ 4.1.1 and 5.0-SNAPSHOT.
I've also tried both Spring 1.2.8 and Spring 2.0 with these configs:

--------- Spring 1.2.8 ------------
<bean id="brokerFactory" class="org.apache.activemq.xbean.BrokerFactoryBean">
                <property name="config" value="classpath:/my-activemq.xml" />
                <property name="start" value="true" />
        </bean>

-------- Spring 2.0 --------------
 <amq:broker brokerName="brokerFactory" useJmx="true" persistent="false">
        <amq:managementContext >
    <amq:managementContext connectorPort="1099" jmxDomainName="org.apache.activemq"/>
    </amq:managementContext>
...
  </amq:broker>

I'm not sure how to read this issue, but does this (https://issues.apache.org/activemq/browse/AMQ-1090) mean that since this 100% issue was reported in 2006, it's not a priority fix until release 5.2.0?  Any temporary fixes for this?

shital wrote:
yes i think my consumer can not keep up. but what can i do to control cpu usage ?
I will try this sleep(..) idea and see whats happen ?

Thanks for helping..
Shital