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

cdc: adjust sorter options to avoid Seek CPU usage exploding (#11099) #11133

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
3 changes: 2 additions & 1 deletion cdc/processor/sourcemanager/engine/pebble/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ func buildPebbleOption(cfg *config.DBConfig) (opts *pebble.Options) {
opts.DisableWAL = false // Delete range requires WAL.
opts.MaxOpenFiles = cfg.MaxOpenFiles / cfg.Count
opts.MaxConcurrentCompactions = 6
opts.L0CompactionThreshold = cfg.CompactionL0Trigger
opts.L0CompactionThreshold = 4 // Default for PebbleDB.
opts.L0CompactionFileThreshold = cfg.CompactionL0Trigger
opts.L0StopWritesThreshold = cfg.WriteL0PauseTrigger
opts.LBaseMaxBytes = 64 << 20 // 64 MB
opts.MemTableSize = cfg.WriterBufferSize
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestParseCfg(t *testing.T) {
WriterBufferSize: 8388608,
Compression: "snappy",
WriteL0PauseTrigger: math.MaxInt32,
CompactionL0Trigger: 160,
CompactionL0Trigger: 16,
CompactionDeletionThreshold: 10485760,
CompactionPeriod: 1800,
IteratorMaxAliveDuration: 10000,
Expand Down Expand Up @@ -465,7 +465,7 @@ cert-allowed-cn = ["dd","ee"]
WriterBufferSize: 8388608,
Compression: "snappy",
WriteL0PauseTrigger: math.MaxInt32,
CompactionL0Trigger: 160,
CompactionL0Trigger: 16,
CompactionDeletionThreshold: 10485760,
CompactionPeriod: 1800,
IteratorMaxAliveDuration: 10000,
Expand Down Expand Up @@ -532,7 +532,7 @@ unknown3 = 3
WriterBufferSize: 8388608,
Compression: "snappy",
WriteL0PauseTrigger: math.MaxInt32,
CompactionL0Trigger: 160,
CompactionL0Trigger: 16,
CompactionDeletionThreshold: 10485760,
CompactionPeriod: 1800,
IteratorMaxAliveDuration: 10000,
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const (
"writer-buffer-size": 8388608,
"compression": "snappy",
"write-l0-pause-trigger": 2147483647,
"compaction-l0-trigger": 160,
"compaction-l0-trigger": 16,
"compaction-deletion-threshold": 10485760,
"compaction-period": 1800,
"iterator-max-alive-duration": 10000,
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type DBConfig struct {
// CompactionL0Trigger defines number of db sst file at level-0 that will
// trigger compaction.
//
// The default value is 160.
// The default value is 16, which is based on a performance test on 4K tables.
CompactionL0Trigger int `toml:"compaction-l0-trigger" json:"compaction-l0-trigger"`
// CompactionDeletionThreshold defines the threshold of the number of deletion that
// trigger compaction.
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var defaultServerConfig = &ServerConfig{
WriterBufferSize: 8388608,
Compression: "snappy",
WriteL0PauseTrigger: math.MaxInt32,
CompactionL0Trigger: 160,
CompactionL0Trigger: 16,
CompactionDeletionThreshold: 10485760,
CompactionPeriod: 1800,
IteratorMaxAliveDuration: 10000,
Expand Down
Loading