Skip to content
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
12 changes: 8 additions & 4 deletions config/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ func initInstanceConfig(file *os.File, cfgInstance *Instance) error {
}

const (
DefaultStorageConcurrency = 100
DefaultStatPort = 7432
DefaultPsqlPort = 8432
DefaultMetricsPort = 2112
DefaultStorageConcurrency = 100
DefaultCopyStorageConcurrency = 200
DefaultStatPort = 7432
DefaultPsqlPort = 8432
DefaultMetricsPort = 2112

DefaultEndpointSourceScheme = "https"

Expand All @@ -89,6 +90,9 @@ func EmbedDefaults(cfgInstance *Instance) {
if cfgInstance.StorageCnf.StorageConcurrency == 0 {
cfgInstance.StorageCnf.StorageConcurrency = DefaultStorageConcurrency
}
if cfgInstance.StorageCnf.CopyStorageConcurrency == 0 {
cfgInstance.StorageCnf.CopyStorageConcurrency = DefaultCopyStorageConcurrency
}
if cfgInstance.BackupStorageCnf.StorageType == "" {
cfgInstance.BackupStorageCnf.StorageType = "s3"
}
Expand Down
3 changes: 2 additions & 1 deletion config/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ type Storage struct {
TablespaceMap map[string]string `json:"tablespace_map" toml:"tablespace_map" yaml:"tablespace_map"`

// how many concurrent connection acquire allowed
StorageConcurrency int64 `json:"storage_concurrency" toml:"storage_concurrency" yaml:"storage_concurrency"`
StorageConcurrency int64 `json:"storage_concurrency" toml:"storage_concurrency" yaml:"storage_concurrency"`
CopyStorageConcurrency int64 `json:"copy_storage_concurrency" toml:"copy_storage_concurrency" yaml:"copy_storage_concurrency"`

// default will be false
EnableRateLimiter bool `json:"enable_rate_limiter" toml:"enable_rate_limiter" yaml:"enable_rate_limiter"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/proc/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func ProcessCopyExtended(
for len(objectMetas) > 0 && retryCount < 10 {
retryCount++

sem := semaphore.NewWeighted(200)
sem := semaphore.NewWeighted(config.InstanceConfig().StorageCnf.CopyStorageConcurrency)

wg := sync.WaitGroup{}

Expand Down
Loading