You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "HQebupt (via GitHub)" <gi...@apache.org> on 2023/05/31 15:04:34 UTC

[GitHub] [bookkeeper] HQebupt commented on a diff in pull request #3976: [improve] add read rate limter for compaction

HQebupt commented on code in PR #3976:
URL: https://github.com/apache/bookkeeper/pull/3976#discussion_r1211868616


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java:
##########
@@ -619,9 +622,10 @@ void doCompactEntryLogs(double threshold, long maxTimeMillis) throws EntryLogMet
                                 meta.getEntryLogId(), meta.getUsage(), threshold);
                     }
 
-                    long priorRemainingSize = meta.getRemainingSize();
+                    long compactSize = meta.getTotalSize() - meta.getRemainingSize();
+                    compactionReadByteRateLimiter.acquire((int) (compactSize));
                     compactEntryLog(meta);

Review Comment:
   @wenbingshen It did not help after I cherry pick https://github.com/apache/bookkeeper/pull/2963. We can discuss it when you are available tomorrow.
   ```
   // Set the rate at which compaction will readd entries. The unit is bytes added per second.
    compactionRateByBytes=31457280
   ```
   ![image](https://github.com/apache/bookkeeper/assets/4970972/f1bbc22b-c260-4fe8-bcf7-a65ab4373243)
   
   ![image](https://github.com/apache/bookkeeper/assets/4970972/9ec7df87-bc1b-4137-b4ac-9f7476b99d9a)
   



-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org