Skip to content

Commit

Permalink
MB-48157 Reduce idle time CPU utilisation of projector
Browse files Browse the repository at this point in the history
Idle time CPU utilisation is high because the endpoint::run
method wakes every 1ms for flushing the bucker. The ticker
interval has been reduced to 1ms to achieve low session
consistent scan latencies with less KV ops/sec rate.

With this patch, the flushTick is moved back to 25ms. When
a mutation is to be processed, we flush it if there are more
than 100 mutations in the queue or the time since last flush
is greater than 1ms - so, scan latencies should not be impacted.

Change-Id: I67718e6f1b971e46d9137145e6fb5996ca3771d5
  • Loading branch information
varunv-cb committed Aug 27, 2021
1 parent df63041 commit 2c56691
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions secondary/common/config.go
Expand Up @@ -366,10 +366,10 @@ var SystemConfig = Config{
false, // case-insensitive
},
"projector.dataport.bufferTimeout": ConfigValue{
1, // 1ms
25, // 25ms
"timeout in milliseconds, to flush vbucket-mutations from, " +
"endpoint, does not affect existing feeds.",
1, // 1ms
25, // 25ms
false, // mutable
false, // case-insensitive
},
Expand Down
2 changes: 1 addition & 1 deletion secondary/dataport/endpoint.go
Expand Up @@ -368,7 +368,7 @@ loop:
})

messageCount++ // count queued up mutations.
if messageCount > endpoint.bufferSize {
if messageCount > endpoint.bufferSize || time.Since(lastActiveTime) > time.Duration(1*time.Millisecond) {
if err := flushBuffers(); err != nil {
break loop
}
Expand Down

0 comments on commit 2c56691

Please sign in to comment.