Skip to content

Commit

Permalink
fix(Dgraph): Perform rollups more aggresively. (#6143)
Browse files Browse the repository at this point in the history
- Reduce batch size to 16.
- Force a rollup to happen every 500ms instead of 2s.

Related to DGRAPH-2202
  • Loading branch information
martinmr authored Aug 6, 2020
1 parent 885ef67 commit fa013db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit fa013db

Please sign in to comment.