diff --git a/cli/linter/schema.json b/cli/linter/schema.json index fe31e711514..96380788a14 100644 --- a/cli/linter/schema.json +++ b/cli/linter/schema.json @@ -405,15 +405,6 @@ "jsvm_timeout": { "type": "integer" }, - "enable_leaky_bucket_rate_limiter": { - "type": "boolean" - }, - "enable_rate_limiter_storage": { - "type": "boolean" - }, - "rate_limiter_storage": { - "$ref": "#/definitions/StorageOptions" - }, "enable_non_transactional_rate_limiter": { "type": "boolean" }, diff --git a/config/development.go b/config/development.go index fb4a294ef63..17cb9e3a1b4 100644 --- a/config/development.go +++ b/config/development.go @@ -5,6 +5,15 @@ package config // DevelopmentConfig extends Config for development builds. type DevelopmentConfig struct { + // EnableLeakyBucketRateLimiter enables leaky bucket rate limiting. + // + // LeakyBucket will delay requests so they are processed in a FIFO + // style queue, ensuring a constant request rate and smoothing out + // traffic spikes. This comes at some cost to gateway instances, as + // the connections would be held for a longer time, instead of + // blocking the requests when they go over the defined rate limits. + EnableLeakyBucketRateLimiter bool `json:"enable_leaky_bucket_rate_limiter"` + // EnableTokenBucket enables token bucket rate limiting. EnableTokenBucketRateLimiter bool `json:"enable_token_bucket_rate_limiter"` diff --git a/config/rate_limit.go b/config/rate_limit.go index da5a1cb6e3f..df0530d938f 100644 --- a/config/rate_limit.go +++ b/config/rate_limit.go @@ -7,15 +7,6 @@ import ( // RateLimit contains flags and configuration for controlling rate limiting behaviour. // It is embedded in the main config structure. type RateLimit struct { - // EnableLeakyBucketRateLimiter enables leaky bucket rate limiting. - // - // LeakyBucket will delay requests so they are processed in a FIFO - // style queue, ensuring a constant request rate and smoothing out - // traffic spikes. This comes at some cost to gateway instances, as - // the connections would be held for a longer time, instead of - // blocking the requests when they go over the defined rate limits. - EnableLeakyBucketRateLimiter bool `json:"enable_leaky_bucket_rate_limiter"` - // Redis based rate limiter with fixed window. Provides 100% rate limiting accuracy, but require two additional Redis roundtrip for each request. EnableRedisRollingLimiter bool `json:"enable_redis_rolling_limiter"` @@ -48,10 +39,6 @@ func (r *RateLimit) String() string { info = "using pipeline" } - if r.EnableLeakyBucketRateLimiter { - return "Leaky Bucket Rate Limiter enabled" - } - if r.EnableRedisRollingLimiter { return fmt.Sprintf("Redis Rate Limiter enabled (%s)", info) } diff --git a/gateway/mw_rate_limiting_test.go b/gateway/mw_rate_limiting_test.go index 90c0a2d9436..f0efcb4cd31 100644 --- a/gateway/mw_rate_limiting_test.go +++ b/gateway/mw_rate_limiting_test.go @@ -240,8 +240,6 @@ func providerCustomRatelimitKey(t *testing.T, limiter string) { globalConf.RateLimit.DRLEnableSentinelRateLimiter = true case "NonTransactional": globalConf.RateLimit.EnableNonTransactionalRateLimiter = true - case "LeakyBucket": - globalConf.RateLimit.EnableLeakyBucketRateLimiter = true default: t.Fatal("There is no such a rate limiter:", limiter) } @@ -396,7 +394,3 @@ func TestMwRateLimiting_CustomRatelimitKeyDRL(t *testing.T) { func TestMwRateLimiting_CustomRatelimitKeyNonTransactional(t *testing.T) { providerCustomRatelimitKey(t, "NonTransactional") } - -func TestMwRateLimiting_CustomRatelimitKeyEnableLeakyBucketRateLimiter(t *testing.T) { - providerCustomRatelimitKey(t, "LeakyBucket") -} diff --git a/internal/rate/rate_nodev.go b/internal/rate/rate_nodev.go index 16bcfc850cd..059b7ecae67 100644 --- a/internal/rate/rate_nodev.go +++ b/internal/rate/rate_nodev.go @@ -10,8 +10,5 @@ import ( // LimiterKind returns the kind of rate limiter enabled by config. // This function is used for release builds. func LimiterKind(c *config.Config) (string, bool) { - if c.EnableLeakyBucketRateLimiter { - return LimitLeakyBucket, true - } return "", false }