lizhimins opened a new issue, #10270:
URL: https://github.com/apache/rocketmq/issues/10270

   ### Before Creating the Enhancement Request
   
   - [x] I have confirmed that this should be classified as an enhancement 
rather than a bug/feature.
   
   
   ### Summary
   
   Make the Pop Consumer RocksDB BlockCache size configurable through 
`MessageStoreConfig` instead of being hardcoded, allowing operators to tune it 
based on their deployment's memory budget.
   
   ### Motivation
   
   The Pop Consumer RocksDB store (`PopConsumerRocksdbStore`) creates two 
ColumnFamilies (default and popState), each with its own independent 
BlockCache. Previously, the BlockCache was hardcoded at 1024MB per ColumnFamily 
in `RocksDBOptionsFactory.createPopCFOptions()`, consuming ~2GB of memory even 
though the Pop workload primarily performs sequential reads where OS PageCache 
handles data block caching effectively.
   
   For containers with limited memory budgets (e.g., 8GB pods with 4GB JVM 
heap), this hardcoded allocation leaves insufficient room for RocketMQ's 
PageCache requirements (CommitLog MappedFile, ConsumeQueue, etc.) and JVM 
off-heap overhead.
   
   ### Describe the Solution You'd Like
   
   1. Add `popRocksdbBlockCacheSize` (default 256MB) to `MessageStoreConfig` as 
a configurable property.
   2. Update `RocksDBOptionsFactory.createPopCFOptions(long blockCacheSize)` to 
accept the cache size as a parameter.
   3. `PopConsumerRocksdbStore` reads the value from `MessageStoreConfig` 
during initialization.
   
   ### Describe Alternatives You've Considered
   
   - **Disabling BlockCache entirely**: RocksDB requires a non-null block 
cache, so this is not possible.
   - **Hardcoding a smaller value (e.g., 16MB)**: This would not allow 
operators to adjust based on their specific workload or memory capacity.
   - **Using BrokerConfig instead**: `MessageStoreConfig` is the existing home 
for RocksDB-related configuration and is already passed to the Pop Consumer 
initialization chain.
   
   ### Additional Context
   
   The change touches the following files:
   - 
`store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java`
   - 
`store/src/main/java/org/apache/rocketmq/store/rocksdb/RocksDBOptionsFactory.java`
   - 
`broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerRocksdbStore.java`
   - 
`broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java`


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