activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1030135 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Date Tue, 02 Nov 2010 17:26:21 GMT
Author: chirino
Date: Tue Nov  2 17:26:17 2010
New Revision: 1030135

URL: http://svn.apache.org/viewvc?rev=1030135&view=rev
Log:
tuned the slow consumer detection logic.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1030135&r1=1030134&r2=1030135&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Tue Nov  2 17:26:17 2010
@@ -90,9 +90,9 @@ class Queue(val host: VirtualHost, var i
 
   /**
    * Subscribers that consume slower than this rate per seconds will be considered
-   * slow.
+   * slow.  Once a consumer is considered slow, we may switch to disk spooling.
    */
-  var tune_slow_subscription_rate = 500*1024
+  var tune_slow_subscription_rate = 2*1024*1024
 
   /**
    * The number of milliseconds between slow consumer checks.
@@ -322,19 +322,20 @@ class Queue(val host: VirtualHost, var i
             val cursor_delta = sub.advanced_size - sub.last_advanced_size
             sub.last_advanced_size = sub.advanced_size
 
-            // If the subscription is NOT slow if it's been tail parked or
-            // it's been parking and cursoring through the data at the tune_slow_subscription_rate

-            if( (sub.tail_parked && sub.tail_parkings==0) || ( sub.tail_parkings
> 0 && cursor_delta >= slow_cursor_delta ) ) {
+            // If the subscription is NOT slow if it's it is tail parked or
+            // it's been parking or at least advancing through the data at
+            // the tune_slow_subscription_rate
+            if( sub.tail_parked || sub.tail_parkings>0 || cursor_delta >= slow_cursor_delta
) {
               if( sub.slow ) {
                 debug("subscription is now fast: %s", sub)
                 sub.slow_intervals = 0
               }
             } else {
               if( !sub.slow ) {
-                trace("slow interval: %d, %d, %d", sub.slow_intervals, sub.tail_parkings,
cursor_delta)
+                debug("slow interval: %d, %d, %d < %d", sub.slow_intervals, sub.tail_parkings,
cursor_delta, slow_cursor_delta)
                 sub.slow_intervals += 1
                 if( sub.slow ) {
-                  debug("subscription is now slow: %s", sub)
+                  debug("subscription is slow: %s", sub)
                 }
               }
             }



Mime
View raw message