keith-turner commented on code in PR #5129:
URL: https://github.com/apache/accumulo/pull/5129#discussion_r1873779416


##########
core/src/main/java/org/apache/accumulo/core/conf/Property.java:
##########
@@ -425,6 +425,12 @@ public enum Property {
       "The number of threads used to run fault-tolerant executions (FATE)."
           + " These are primarily table operations like merge.",
       "1.4.3"),
+  MANAGER_FATE_QUEUE_CHECK_INTERVAL("manager.fate.queue.check.interval", "60m",
+      PropertyType.TIMEDURATION,
+      "The interval at which to check if the number of available Fate threads 
has consistently been zero."

Review Comment:
   ```suggestion
         "The interval at which to check if the number of idle Fate threads has 
consistently been zero."
   ```



##########
core/src/main/java/org/apache/accumulo/core/fate/Fate.java:
##########
@@ -372,6 +375,39 @@ public Fate(T environment, FateStore<T> store, boolean 
runDeadResCleaner,
             break;
           }
         }
+        queueSizeHistory.clear();
+      } else {
+        // The property did not change, but should it based on available Fate 
threads? Maintain
+        // the last X minutes of available Fate threads. If always zero, then 
suggest that the
+        // MANAGER_FATE_THREADPOOL_SIZE be increased.
+        final long interval = Math.min(60, TimeUnit.MILLISECONDS
+            
.toMinutes(conf.getTimeInMillis(Property.MANAGER_FATE_QUEUE_CHECK_INTERVAL)));
+        if (interval == 0) {
+          queueSizeHistory.clear();
+        } else {
+          if (queueSizeHistory.size() >= interval * 2) { // this task runs 
every 30s
+            boolean needMoreThreads = true;
+            for (Integer i : queueSizeHistory) {
+              if (i > 0) {
+                needMoreThreads = false;

Review Comment:
   On a system that is consistently busy if sampling alot will probably catch 
this as non zero a few times, just catching threads that are just about to get 
work.  Could count the non-zero and make needMoreThreads based on seeing 95% of 
sample events being zero.



##########
core/src/main/java/org/apache/accumulo/core/fate/Fate.java:
##########
@@ -83,6 +84,7 @@ public class Fate<T> {
   private final AtomicBoolean keepRunning = new AtomicBoolean(true);
   private final TransferQueue<FateId> workQueue;
   private final Thread workFinder;
+  private final ConcurrentLinkedQueue<Integer> queueSizeHistory = new 
ConcurrentLinkedQueue<>();

Review Comment:
   ```suggestion
     private final ConcurrentLinkedQueue<Integer> idleCountHistory = new 
ConcurrentLinkedQueue<>();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to