aboutsummaryrefslogtreecommitdiff
path: root/weed/config/s3_config.go
diff options
context:
space:
mode:
author石昌林 <changlin.shi@ly.com>2022-06-15 21:07:55 +0800
committer石昌林 <changlin.shi@ly.com>2022-06-15 21:07:55 +0800
commit78b372816935c663f7f56b92e0e79e37e99cd4d2 (patch)
treee5867fad83ef484f406f660097bbaf07258c6dcd /weed/config/s3_config.go
parentb22ca85fbb674c445096b739af142dbf53dbd72b (diff)
downloadseaweedfs-78b372816935c663f7f56b92e0e79e37e99cd4d2.tar.xz
seaweedfs-78b372816935c663f7f56b92e0e79e37e99cd4d2.zip
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
Diffstat (limited to 'weed/config/s3_config.go')
-rw-r--r--weed/config/s3_config.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/weed/config/s3_config.go b/weed/config/s3_config.go
new file mode 100644
index 000000000..be504fb9f
--- /dev/null
+++ b/weed/config/s3_config.go
@@ -0,0 +1,16 @@
+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)
+}