@@ -1045,7 +1045,7 @@ internal class RocksDbWriteBatch : IWriteBatch
1045
1045
/// we writes the batch in smaller batches. This removes atomicity so its only turned on when NoWAL flag is on.
1046
1046
/// It does not work as well as just turning on unordered_write, but Snapshot and Iterator can still works.
1047
1047
/// </summary>
1048
- private const int MaxWritesOnNoWal = 128 ;
1048
+ private const int MaxWritesOnNoWal = 256 ;
1049
1049
private int _writeCount ;
1050
1050
1051
1051
public RocksDbWriteBatch ( DbOnTheRocks dbOnTheRocks )
@@ -1435,13 +1435,13 @@ private IDictionary<string, string> GetHeavyWriteOptions(ulong l0SizeTarget)
1435
1435
// Make buffer (probably) smaller so that it does not take too much memory to have many of them.
1436
1436
// More buffer means more parallel flush, but each read have to go through all buffer one by one much like l0
1437
1437
// but no io, only cpu.
1438
- // bufferSize*maxBufferNumber = 128MB , which is the max memory used, which tend to be the case as its now
1438
+ // bufferSize*maxBufferNumber = 16MB*Core count , which is the max memory used, which tend to be the case as its now
1439
1439
// stalled by compaction instead of flush.
1440
1440
// The buffer is not compressed unlike l0File, so to account for it, its size need to be slightly larger.
1441
1441
ulong targetFileSize = ( ulong ) 16 . MiB ( ) ;
1442
1442
ulong bufferSize = ( ulong ) ( targetFileSize / _perTableDbConfig . CompressibilityHint ) ;
1443
1443
ulong l0FileSize = targetFileSize * ( ulong ) _minWriteBufferToMerge ;
1444
- ulong maxBufferNumber = 8 ;
1444
+ ulong maxBufferNumber = ( ulong ) Environment . ProcessorCount ;
1445
1445
1446
1446
// Guide recommend to have l0 and l1 to be the same size. They have to be compacted together so if l1 is larger,
1447
1447
// the extra size in l1 is basically extra rewrites. If l0 is larger... then I don't know why not. Even so, it seems to
0 commit comments