mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
remove requests deadline, instead just reject the requests (#20272)
Additionally set - x-ratelimit-limit - x-ratelimit-remaining To indicate the request rates.
This commit is contained in:
@@ -33,7 +33,6 @@ import (
|
||||
// API sub-system constants
|
||||
const (
|
||||
apiRequestsMax = "requests_max"
|
||||
apiRequestsDeadline = "requests_deadline"
|
||||
apiClusterDeadline = "cluster_deadline"
|
||||
apiCorsAllowOrigin = "cors_allow_origin"
|
||||
apiRemoteTransportDeadline = "remote_transport_deadline"
|
||||
@@ -81,6 +80,7 @@ const (
|
||||
// Deprecated key and ENVs
|
||||
const (
|
||||
apiReadyDeadline = "ready_deadline"
|
||||
apiRequestsDeadline = "requests_deadline"
|
||||
apiReplicationWorkers = "replication_workers"
|
||||
apiReplicationFailedWorkers = "replication_failed_workers"
|
||||
)
|
||||
@@ -92,10 +92,6 @@ var (
|
||||
Key: apiRequestsMax,
|
||||
Value: "0",
|
||||
},
|
||||
config.KV{
|
||||
Key: apiRequestsDeadline,
|
||||
Value: "10s",
|
||||
},
|
||||
config.KV{
|
||||
Key: apiClusterDeadline,
|
||||
Value: "10s",
|
||||
@@ -171,7 +167,6 @@ var (
|
||||
// Config storage class configuration
|
||||
type Config struct {
|
||||
RequestsMax int `json:"requests_max"`
|
||||
RequestsDeadline time.Duration `json:"requests_deadline"`
|
||||
ClusterDeadline time.Duration `json:"cluster_deadline"`
|
||||
CorsAllowOrigin []string `json:"cors_allow_origin"`
|
||||
RemoteTransportDeadline time.Duration `json:"remote_transport_deadline"`
|
||||
@@ -205,6 +200,7 @@ func (sCfg *Config) UnmarshalJSON(data []byte) error {
|
||||
func LookupConfig(kvs config.KVS) (cfg Config, err error) {
|
||||
deprecatedKeys := []string{
|
||||
apiReadyDeadline,
|
||||
apiRequestsDeadline,
|
||||
"extend_list_cache_life",
|
||||
apiReplicationWorkers,
|
||||
apiReplicationFailedWorkers,
|
||||
@@ -251,12 +247,6 @@ func LookupConfig(kvs config.KVS) (cfg Config, err error) {
|
||||
return cfg, errors.New("invalid API max requests value")
|
||||
}
|
||||
|
||||
requestsDeadline, err := time.ParseDuration(env.Get(EnvAPIRequestsDeadline, kvs.GetWithDefault(apiRequestsDeadline, DefaultKVS)))
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
cfg.RequestsDeadline = requestsDeadline
|
||||
|
||||
clusterDeadline, err := time.ParseDuration(env.Get(EnvAPIClusterDeadline, kvs.GetWithDefault(apiClusterDeadline, DefaultKVS)))
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
|
||||
@@ -28,16 +28,10 @@ var (
|
||||
Help = config.HelpKVS{
|
||||
config.HelpKV{
|
||||
Key: apiRequestsMax,
|
||||
Description: `set the maximum number of concurrent requests` + defaultHelpPostfix(apiRequestsMax),
|
||||
Description: `set the maximum number of concurrent requests (default: auto)`,
|
||||
Optional: true,
|
||||
Type: "number",
|
||||
},
|
||||
config.HelpKV{
|
||||
Key: apiRequestsDeadline,
|
||||
Description: `set the deadline for API requests waiting to be processed` + defaultHelpPostfix(apiRequestsDeadline),
|
||||
Optional: true,
|
||||
Type: "duration",
|
||||
},
|
||||
config.HelpKV{
|
||||
Key: apiClusterDeadline,
|
||||
Description: `set the deadline for cluster readiness check` + defaultHelpPostfix(apiClusterDeadline),
|
||||
|
||||
Reference in New Issue
Block a user