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

feat(hatchery): MaxConcurrentRegistering #4244

Merged
merged 2 commits into from May 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions sdk/hatchery/register.go
Expand Up @@ -3,7 +3,6 @@ package hatchery
import (
"context"
"fmt"
"math"
"strings"
"sync/atomic"

Expand Down Expand Up @@ -40,7 +39,7 @@ func workerRegister(ctx context.Context, h Interface, startWorkerChan chan<- wor
continue
}

maxRegistration := int64(math.Floor(float64(h.Configuration().Provision.MaxWorker) / 4))
maxRegistration := int64(h.Configuration().Provision.MaxConcurrentRegistering)
if atomic.LoadInt64(&nbRegisteringWorkerModels) > maxRegistration {
log.Debug("hatchery> workerRegister> max registering worker reached")
return nil
Expand Down
1 change: 1 addition & 0 deletions sdk/hatchery/types.go
Expand Up @@ -35,6 +35,7 @@ type CommonConfiguration struct {
Frequency int `toml:"frequency" default:"30" comment:"Check provisioning each n Seconds" json:"frequency"`
MaxWorker int `toml:"maxWorker" default:"10" comment:"Maximum allowed simultaneous workers" json:"maxWorker"`
MaxConcurrentProvisioning int `toml:"maxConcurrentProvisioning" default:"10" comment:"Maximum allowed simultaneous workers provisioning" json:"maxConcurrentProvisioning"`
MaxConcurrentRegistering int `toml:"maxConcurrentRegistering" default:"2" comment:"Maximum allowed simultaneous workers registering" json:"maxConcurrentRegistering"`
GraceTimeQueued int `toml:"graceTimeQueued" default:"4" comment:"if worker is queued less than this value (seconds), hatchery does not take care of it" json:"graceTimeQueued"`
RegisterFrequency int `toml:"registerFrequency" default:"60" comment:"Check if some worker model have to be registered each n Seconds" json:"registerFrequency"`
WorkerLogsOptions struct {
Expand Down