You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/03/18 15:54:36 UTC

[GitHub] [bookkeeper] merlimat commented on a change in pull request #2647: Limit read-ahead bytes to the size of the read cache

merlimat commented on a change in pull request #2647:
URL: https://github.com/apache/bookkeeper/pull/2647#discussion_r597003069



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
##########
@@ -155,6 +157,9 @@ public SingleDirectoryDbLedgerStorage(ServerConfiguration conf, LedgerManager le
         readCacheMaxSize = readCacheSize;
         readAheadCacheBatchSize = conf.getInt(READ_AHEAD_CACHE_BATCH_SIZE, DEFAULT_READ_AHEAD_CACHE_BATCH_SIZE);
 
+        // Do not attempt to perform read-ahead more than half the total size of the cache
+        maxReadAheadBytesSize = readCacheMaxSize / 2;

Review comment:
       It's already being accounted in that `readCacheMaxSize` size is divided evenly divided by the directories.




-- 
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