From fa013db935cdc64ca5eb31139057528d83751a3b Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Thu, 6 Aug 2020 16:05:28 -0700 Subject: [PATCH] fix(Dgraph): Perform rollups more aggresively. (#6143) - Reduce batch size to 16. - Force a rollup to happen every 500ms instead of 2s. Related to DGRAPH-2202 --- posting/mvcc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posting/mvcc.go b/posting/mvcc.go index 2f5b3d0a9d1..cc575e5d31c 100644 --- a/posting/mvcc.go +++ b/posting/mvcc.go @@ -86,7 +86,7 @@ func (ir *incrRollupi) rollUpKey(writer *TxnWriter, key []byte) error { func (ir *incrRollupi) addKeyToBatch(key []byte) { batch := ir.keysPool.Get().(*[][]byte) *batch = append(*batch, key) - if len(*batch) < 64 { + if len(*batch) < 16 { ir.keysPool.Put(batch) return } @@ -112,7 +112,7 @@ func (ir *incrRollupi) Process(closer *y.Closer) { defer limiter.Stop() cleanupTick := time.NewTicker(5 * time.Minute) defer cleanupTick.Stop() - forceRollupTick := time.NewTicker(2 * time.Second) + forceRollupTick := time.NewTicker(500 * time.Millisecond) defer forceRollupTick.Stop() var batch *[][]byte