mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
Make number of replication workers configurable. (#11379)
MINIO_API_REPLICATION_WORKERS env.var and `mc admin config set api` allow number of replication workers to be configurable. Defaults to half the number of cpus available. Co-authored-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
committed by
GitHub
parent
c4848f9b4f
commit
fe3aca70c3
@@ -36,7 +36,8 @@ type apiConfig struct {
|
||||
extendListLife time.Duration
|
||||
corsAllowOrigins []string
|
||||
// total drives per erasure set across pools.
|
||||
totalDriveCount int
|
||||
totalDriveCount int
|
||||
replicationWorkers int
|
||||
}
|
||||
|
||||
func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
|
||||
@@ -78,6 +79,7 @@ func (t *apiConfig) init(cfg api.Config, setDriveCounts []int) {
|
||||
t.requestsDeadline = cfg.RequestsDeadline
|
||||
t.listQuorum = cfg.GetListQuorum()
|
||||
t.extendListLife = cfg.ExtendListLife
|
||||
t.replicationWorkers = cfg.ReplicationWorkers
|
||||
}
|
||||
|
||||
func (t *apiConfig) getListQuorum() int {
|
||||
@@ -152,3 +154,10 @@ func maxClients(f http.HandlerFunc) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *apiConfig) getReplicationWorkers() int {
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
|
||||
return t.replicationWorkers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user