mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
* s3 backend: HTTP/1.1 client defaults for disable_http2 ## Problem `disable_http2` (#11897) keeps the cloud tier's S3 client on HTTP/1.1, so every tier upload and range read gets a connection of its own. The rest of the client still has the defaults sized for one multiplexed HTTP/2 connection: - Go's idle pool keeps only 2 connections per host, so a burst of concurrent range reads redials TLS for almost every request once the burst is over and the next one starts; - the wait for response headers is the 60 s bound every tier client has; - the SDK retries 3 times. On a Ceph RGW-based S3 service, HTTP/2's small flow-control window held tier uploads at 18 MB/s and made 24 concurrent cold scans take 52 s each; on HTTP/1.1 they took 3.7 s each, but only with a larger idle pool, a shorter header bound and more retries for the 503 SlowDown answers that the extra parallelism draws. ## Fix With `disable_http2 = true` the tier client also gets: - an idle pool of 100 (`MaxIdleConns` and `MaxIdleConnsPerHost`); - `ResponseHeaderTimeout` of 30 s; - `MaxRetries` 5, so the SDK's retryer backs off on 5xx, SlowDown and throttling. `max_connections` and `idle_connection_timeout_seconds` apply as before. Without `disable_http2` the client is unchanged. The scaffold `master.toml` mentions the defaults. ## Tests `TestS3BackendHTTP1ClientDefaults` in `weed/storage/backend/s3_backend/s3_sessions_test.go`: with `disable_http2` the transport has the idle pool and the 30 s header bound, and the client 5 retries; without it (and with `max_connections` set) the client keeps the SDK's retries, the default idle pool and `s3ReadTimeout`. It fails without the change. `go vet ./weed/storage/backend/s3_backend/` and `go test ./weed/storage/backend/s3_backend/`: ok. `go build ./weed`: ok. * s3 backend: keep the larger idle pool for every tier client A tier client on a plain http:// endpoint, or on a TLS service that offers no HTTP/2, speaks HTTP/1.1 without disable_http2 and had the same 2 idle connections per host, so each burst of concurrent reads redialed. HTTP/2 keeps one connection, so the pool size does not change it. The header bound and retries stay with disable_http2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
82 lines
3.8 KiB
TOML
82 lines
3.8 KiB
TOML
# Put this file to one of the location, with descending priority
|
|
# ./master.toml
|
|
# $HOME/.seaweedfs/master.toml
|
|
# /etc/seaweedfs/master.toml
|
|
# this file is read by master
|
|
|
|
[master]
|
|
# cap on writable volumes per volume layout (collection + replica placement +
|
|
# ttl + disk type) that write assignments spread over; fullest picked first.
|
|
# 0 = no limit
|
|
max_writable_volumes_per_layout = 0
|
|
|
|
|
|
[master.maintenance]
|
|
# periodically run these scripts are the same as running them from 'weed shell'
|
|
# Scripts are skipped while an admin server is connected.
|
|
scripts = """{{DEFAULT_MAINTENANCE_SCRIPTS}}"""
|
|
sleep_minutes = 17 # sleep minutes between each script execution
|
|
|
|
|
|
# vacuum reclaims deleted space by compacting volumes
|
|
[master.vacuum]
|
|
# concurrent volume compactions per volume server; overrides the deprecated
|
|
# -maxParallelVacuumPerServer flag (default 1) when set; 0 = no limit
|
|
# max_parallel_per_server = 1
|
|
# concurrent volume copies compacting within one rack; 0 = no limit
|
|
max_parallel_per_rack = 0
|
|
|
|
|
|
[master.sequencer]
|
|
type = "raft" # Choose [raft|snowflake] type for storing the file id sequence
|
|
# when sequencer.type = snowflake, the snowflake id must be different from other masters
|
|
sequencer_snowflake_id = 0 # any number between 1~1023
|
|
|
|
|
|
# configurations for tiered cloud storage
|
|
# old volumes are transparently moved to cloud for cost efficiency
|
|
[storage.backend]
|
|
[storage.backend.s3.default]
|
|
enabled = false
|
|
aws_access_key_id = "" # if empty, loads from the shared credentials file (~/.aws/credentials).
|
|
aws_secret_access_key = "" # if empty, loads from the shared credentials file (~/.aws/credentials).
|
|
region = "us-east-2"
|
|
bucket = "your_bucket_name" # an existing bucket
|
|
endpoint = ""
|
|
storage_class = "STANDARD_IA"
|
|
# optional HTTP client tuning for S3-compatible services:
|
|
# disable_http2 = false # true keeps the client on HTTP/1.1, one connection per concurrent request,
|
|
# # with a 30s response header timeout and 5 retries
|
|
# max_connections = 0 # cap on connections to the endpoint, 0 = no cap
|
|
# idle_connection_timeout_seconds = 0 # close idle connections sooner, 0 = Go default (90s)
|
|
|
|
# create this number of logical volumes if no more writable volumes
|
|
# count_x means how many copies of data.
|
|
# e.g.:
|
|
# 000 has only one copy, copy_1
|
|
# 010 and 001 has two copies, copy_2
|
|
# 011 has only 3 copies, copy_3
|
|
# The filer's metadata log collection grows by metaLog.volumeGrowthCount in
|
|
# filer.toml instead; volume servers keep room for both by default (-max=10).
|
|
[master.volume_growth]
|
|
copy_1 = 7 # create 1 x 7 = 7 actual volumes
|
|
copy_2 = 6 # create 2 x 6 = 12 actual volumes
|
|
copy_3 = 3 # create 3 x 3 = 9 actual volumes
|
|
copy_other = 1 # create n x 1 = n actual volumes
|
|
threshold = 0.9 # create threshold
|
|
reservation_timeout = "5m"# capacity reservation timeout before unreleased reservations expire
|
|
disable = false # disables volume growth if true
|
|
# allocation_deferral = "15s" # hold the first volume id allocation after a fresh
|
|
# topology id is minted, giving a rebuilt master's
|
|
# veteran volume servers time to report. The hold
|
|
# lifts early once heartbeats stay clean for two
|
|
# pulses. "0s" disables it (e.g. test setups).
|
|
|
|
# configuration flags for replication
|
|
[master.replication]
|
|
# any replication counts should be considered minimums. If you specify 010 and
|
|
# have 3 different racks, that's still considered writable. Writes will still
|
|
# try to replicate to all available volumes. You should only use this option
|
|
# if you are doing your own replication or periodic sync of volumes.
|
|
treat_replication_as_minimums = false
|