You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Dejan Bosanac (JIRA)" <ji...@apache.org> on 2010/09/30 16:55:40 UTC

[jira] Created: (AMQ-2952) Message groups with small prefetch

Message groups with small prefetch
----------------------------------

                 Key: AMQ-2952
                 URL: https://issues.apache.org/activemq/browse/AMQ-2952
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.4.1
            Reporter: Dejan Bosanac
            Assignee: Dejan Bosanac
             Fix For: 5.5.0


Closing and starting message groups with a lot of consumers and a small prefetch could result in messages being dispatched to wrong consumers. The problem is that message group logic is done before we detecting weather the consumer is full or not. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-2952) Message groups with small prefetch

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-2952.
--------------------------------

    Resolution: Fixed

Fixed with svn commit 1003096, by doing message group operations only if consumer is not full

> Message groups with small prefetch
> ----------------------------------
>
>                 Key: AMQ-2952
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2952
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.1
>            Reporter: Dejan Bosanac
>            Assignee: Dejan Bosanac
>             Fix For: 5.5.0
>
>
> Closing and starting message groups with a lot of consumers and a small prefetch could result in messages being dispatched to wrong consumers. The problem is that message group logic is done before we detecting weather the consumer is full or not. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2952) Message groups with small prefetch

Posted by "Rob Janney (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62927#action_62927 ] 

Rob Janney commented on AMQ-2952:
---------------------------------

We ran into this issue with one of our 5.4.1 AMQ instances in production.  We found that once all consumers are full, the remaining messages are all assigned to a single consumer.  When we reproduced this issue in test & stepped through the Queue class in AMQ, we found that this happens because the group logic is done before the full detection.

For example, we had 15 consumers with a prefetch size of 1 and a backlog of 1000 messages.  Each consumer had at least 1 message assigned to it & some had a few more than that (possibly finished processing the first message before all consumers were full).  Once all 15 consumers were full, the remaining 980 or so messages were assigned to the same consumer :(  This lead to a significant performance problem where we had all the work waiting on a single thread and the other 14 threads idle doing nothing.

We were able to work around this problem by setting the pre-fetch to 100 for our 15 consumers.   This allowed the messages to be dispatched in a  round-robin fashion to the first 1500 messages in the queue.

The fix above to only do group operations on non-full consumers should also resolve the effect we observed.

> Message groups with small prefetch
> ----------------------------------
>
>                 Key: AMQ-2952
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2952
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.1
>            Reporter: Dejan Bosanac
>            Assignee: Dejan Bosanac
>             Fix For: 5.5.0
>
>
> Closing and starting message groups with a lot of consumers and a small prefetch could result in messages being dispatched to wrong consumers. The problem is that message group logic is done before we detecting weather the consumer is full or not. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (AMQ-2952) Message groups with small prefetch

Posted by "Rob Janney (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62927#action_62927 ] 

Rob Janney edited comment on AMQ-2952 at 10/29/10 2:30 PM:
-----------------------------------------------------------

We ran into this issue with one of our 5.4.1 AMQ instances in production.  We found that once all consumers are full, the remaining messages are all assigned to a single consumer.  When we reproduced this issue in test & stepped through the Queue class in AMQ, we found that this happens because the group logic is done before the full detection.

For example, we had 15 consumers with a prefetch size of 1 and a backlog of 1000 messages.  Each consumer had at least 1 message assigned to it & some had a few more than that (possibly finished processing the first message before all consumers were full).  Once all 15 consumers were full, the remaining 980 or so messages were assigned to the same consumer :(  This lead to a significant performance problem where we had all the work waiting on a single thread and the other 14 threads idle doing nothing.

We were able to work around this problem by setting the pre-fetch to 100 for our 15 consumers.   This allowed the messages to be dispatched in a  round-robin fashion for the first 1500 messages in the queue.

The fix above to only do group operations on non-full consumers should also resolve the effect we observed.

      was (Author: robj):
    We ran into this issue with one of our 5.4.1 AMQ instances in production.  We found that once all consumers are full, the remaining messages are all assigned to a single consumer.  When we reproduced this issue in test & stepped through the Queue class in AMQ, we found that this happens because the group logic is done before the full detection.

For example, we had 15 consumers with a prefetch size of 1 and a backlog of 1000 messages.  Each consumer had at least 1 message assigned to it & some had a few more than that (possibly finished processing the first message before all consumers were full).  Once all 15 consumers were full, the remaining 980 or so messages were assigned to the same consumer :(  This lead to a significant performance problem where we had all the work waiting on a single thread and the other 14 threads idle doing nothing.

We were able to work around this problem by setting the pre-fetch to 100 for our 15 consumers.   This allowed the messages to be dispatched in a  round-robin fashion to the first 1500 messages in the queue.

The fix above to only do group operations on non-full consumers should also resolve the effect we observed.
  
> Message groups with small prefetch
> ----------------------------------
>
>                 Key: AMQ-2952
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2952
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.1
>            Reporter: Dejan Bosanac
>            Assignee: Dejan Bosanac
>             Fix For: 5.5.0
>
>
> Closing and starting message groups with a lot of consumers and a small prefetch could result in messages being dispatched to wrong consumers. The problem is that message group logic is done before we detecting weather the consumer is full or not. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.