Performance change to option enable client.QPS, client.Burst

and change default on max_requests_inflight.
This commit is contained in:
Timothy St. Clair
2015-04-09 12:12:52 -05:00
parent 8510fc67ff
commit 2b60111fca
10 changed files with 42 additions and 7 deletions

View File

@@ -80,6 +80,9 @@ type Config struct {
// QPS indicates the maximum QPS to the master from this client. If zero, QPS is unlimited.
QPS float32
// Maximum burst for throttle
Burst int
}
type KubeletConfig struct {
@@ -181,6 +184,9 @@ func SetKubernetesDefaults(config *Config) error {
if config.QPS == 0.0 {
config.QPS = 5.0
}
if config.Burst == 0 {
config.Burst = 10
}
return nil
}
@@ -201,7 +207,7 @@ func RESTClientFor(config *Config) (*RESTClient, error) {
return nil, err
}
client := NewRESTClient(baseURL, config.Version, config.Codec, config.LegacyBehavior, config.QPS)
client := NewRESTClient(baseURL, config.Version, config.Codec, config.LegacyBehavior, config.QPS, config.Burst)
transport, err := TransportFor(config)
if err != nil {