-
Notifications
You must be signed in to change notification settings - Fork 82
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
support least connections #98
support least connections #98
Conversation
support least connections
This is fixing #16 - right? @harshavardhana While I do believe this is a better default than round-robin, I think RR should still be an option, or did you already discuss this? |
yeah. Fixing #16 |
It can be an option, we can take a flag that says Currently what we support is random not round-robin |
Code LGTM, but some minor things: A) change "leastconn" to just |
1 and 2 are there. func (s *site) upBackends() []*Backend {
var backends []*Backend
for _, backend := range s.backends {
if backend.Online() {
backends = append(backends, backend)
}
}
return backends
}
func (s *site) nextProxy() (*Backend, func()) {
backends := s.upBackends()
if len(backends) == 0 {
return nil, func() {}
} |
Co-authored-by: Harshavardhana <harsha@minio.io>
support least connections