Bug 1088600 - [GSS] (6.2.x) Full scheduledReferences traversal in every call to ScheduledDeliveryHandlerImpl$ScheduledDeliveryRunnable.run()
Summary: [GSS] (6.2.x) Full scheduledReferences traversal in every call to ScheduledDe...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: HornetQ
Version: 6.2.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR2
: EAP 6.2.3
Assignee: Clebert Suconic
QA Contact: Martin Svehla
Russell Dickenson
URL:
Whiteboard:
Depends On: 1089838
Blocks: eap62-cp03-blockers 1084639
TreeView+ depends on / blocked
 
Reported: 2014-04-16 20:57 UTC by Jimmy Wilson
Modified: 2014-08-12 02:08 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
HornetQ would consume a lot of CPU if lots of messages were scheduled with a small interval between each message because it would transverse the whole list of messages at every scheduled time.
Clone Of:
: 1089838 (view as bug list)
Environment:
Last Closed: 2014-06-09 12:47:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jimmy Wilson 2014-04-16 20:57:49 UTC
The method ScheduledDeliveryHandlerImpl$ScheduledDeliveryRunnable.run() unnecessarily does a full traversal of the scheduledReferences linked list on each and every call.

When the number of scheduled messages is very large, this traversal severely impacts HornetQ's performance when consuming scheduled messages.

We are using HornetQ 2.2.24 in an application where we schedule ~400,000 messages in a single queue to be consumed several hours into the future, with large bursts of messages to be consumed as quickly as possible. In this application, we have found that HornetQ's rate of consuming scheduled messages is limited by CPU. From performance profiling, we found that the method

org.hornetq.core.server.impl.ScheduledDeliveryHandlerImpl$ScheduledDeliveryRunnable.run()

is consuming approximately 70-80% of the CPU cycles during bursts. Looking at the code, this is due to the full traversal of the scheduledReferences linked list on every call to run():
https://github.com/hornetq/hornetq/blob/HornetQ_2_2_24_EAP_GA/src/main/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java#L181

Comment 1 Martin Svehla 2014-05-06 14:08:18 UTC
Verified with EAP 6.2.3.CP.CR2 / HornetQ 2.3.14.1.Final


Note You need to log in before you can comment on or make changes to this bug.