Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: reduce memory consumption by reducing channel sizes (#1999) #2012

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions cdc/kv/region_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ import (
)

var (
regionWorkerPool workerpool.WorkerPool
workerPoolOnce sync.Once
// The magic number here is keep the same with some magic numbers in some
// other components in TiCDC, including worker pool task chan size, mounter
// chan size etc.
// TODO: unified channel buffer mechanism
regionWorkerInputChanSize = 128000
regionWorkerPool workerpool.WorkerPool
workerPoolOnce sync.Once
regionWorkerInputChanSize = 128
regionWorkerLowWatermark = int(float64(regionWorkerInputChanSize) * 0.2)
regionWorkerHighWatermark = int(float64(regionWorkerInputChanSize) * 0.7)
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/workerpool/pool_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ type worker struct {

func newWorker() *worker {
return &worker{
taskCh: make(chan *task, 128000),
taskCh: make(chan *task, 128),
handles: make(map[*defaultEventHandle]struct{}),
handleCancelCh: make(chan struct{}), // this channel must be unbuffered, i.e. blocking
}
Expand Down