1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-03 01:00:04 +02:00
seaweedfs/weed/config/s3_config.go
石昌林 78b3728169 add s3 circuit breaker support for 'simultaneous request count' and 'simultaneous request bytes' limitations
configure s3 circuit breaker by 'command_s3_circuitbreaker.go':
usage eg:
# Configure the number of simultaneous global (current s3api node) requests
s3.circuit.breaker -global -type count -actions Write -values 1000 -apply

# Configure the number of simultaneous requests for bucket x read and write
s3.circuit.breaker -buckets -type count -actions Read,Write -values 1000 -apply

# Configure the total bytes of simultaneous requests for bucket write
s3.circuit.breaker -buckets -type bytes -actions Write -values 100MiB -apply

# Disable circuit breaker config of bucket 'x'
s3.circuit.breaker -buckets x -enable false -apply

# Delete circuit breaker config of bucket 'x'
s3.circuit.breaker -buckets x -delete -apply
2022-06-15 21:07:55 +08:00

17 lines
403 B
Go

package config
import "strings"
var (
CircuitBreakerConfigDir = "/etc/s3"
CircuitBreakerConfigFile = "circuit_breaker.json"
AllowedActions = []string{"Read", "Write", "List", "Tagging", "Admin"}
LimitTypeCount = "count"
LimitTypeBytes = "bytes"
Separator = ":"
)
func Concat(elements ...string) string {
return strings.Join(elements, Separator)
}