You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2020/03/03 03:35:50 UTC

[GitHub] [drill] paul-rogers commented on a change in pull request #2000: DRILL-7607: Support dynamic credit based flow control

paul-rogers commented on a change in pull request #2000: DRILL-7607: Support dynamic credit based flow control
URL: https://github.com/apache/drill/pull/2000#discussion_r386782336
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/work/batch/UnlimitedRawBatchBuffer.java
 ##########
 @@ -32,12 +33,24 @@
   private final int softlimit;
   private final int startlimit;
 
-  public UnlimitedRawBatchBuffer(FragmentContext context, int fragmentCount) {
-    super(context, fragmentCount);
+  private int runtimeSoftLimit = -1;
+  private int runtimeAckCredit = 1;
+  private int sampleTimes = 0;
+  private long totalBatchSize = 0l;
+  private final int fragmentCount;
+  private final int maxSampleTimes;
+  private final long thresholdNetworkMem;
+
+  public UnlimitedRawBatchBuffer(FragmentContext context, int fragmentCount, boolean enableDynamicFC) {
+    super(context, fragmentCount, enableDynamicFC);
     this.softlimit = bufferSizePerSocket * fragmentCount;
     this.startlimit = Math.max(softlimit/2, 1);
     logger.trace("softLimit: {}, startLimit: {}", softlimit, startlimit);
     this.bufferQueue = new UnlimitedBufferQueue();
+    this.fragmentCount = fragmentCount;
+    this.sampleTimes = fragmentCount;
+    this.maxSampleTimes = fragmentCount;
+    this.thresholdNetworkMem = context.getConfig().getLong(ExecConstants.UNLIMITED__BUFFER_MAX_MEMORY_SIZE);
 
 Review comment:
   I'm concerned that this feature is always enabled with a default size of 500MB. If we assume that most batches are usually < 10MB, we've gone from a potential buffer size of 30MB to one of 500MB. In large queries, this could cause unexpected OOM errors.
   
   Maybe define this so that 0 is the default, and 0 means "don't dynamically change buffer size." This allows us to try out the feature, and for you to use the feature, without running the risk of destabilizing other production sites.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services