Files
seaweedfs/weed/s3api
Chris LuandClaude Opus 5.5 8ffce492fd s3: time each stage of an object write (#12883)
* s3: time each stage of an object write

SeaweedFS_s3_request_seconds times the whole handler, so a slow PUT tail
cannot be split into client upload time and server time. putToFiler now
records SeaweedFS_s3_put_stage_seconds{operation,stage} per write:
body_read (blocked on the request body), assign (volume assigns),
chunk_upload (upload time apart from body reads: waiting on chunk
uploads), and metadata (from the uploaded chunks to the committed entry).
operation is PutObject or UploadPart; no per-bucket or per-object labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* grafana: chart the S3 PUT stage p99

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3: count body reads made before putToFiler in body_read

mimeDetect reads the first bytes, and a POST upload parses the whole form,
before putToFiler starts, so a slow client showed little body_read time.
track now times every read of the request body, body_read reports the
request's total, and chunk_upload subtracts only the reads made during
the upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3: observe body_read once per request

An archive upload writes one object per member, and every write reported
the same request-wide body read time. The first write to finish now
reports it; the other stages stay per write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3: name the non-read upload stage storage

The chunked upload runs volume assigns inside the chunk upload goroutines,
so its time apart from body reads covers assigns and chunk uploads, and
the uploads themselves cannot be timed from outside UploadReaderInChunks.
Call that stage storage; assign stays the summed assign time within it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3: record a zero body_read for writes without a body

timeBodyReads attached no timer to bodyless requests, so a zero-byte PUT
or an UploadPartCopy recorded every stage but body_read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* s3: observe body_read after the handler so it covers every write

An archive request writes several objects from one body. Observing
body_read at the first write's record left out the reads of the later
members. record now only marks the request, and track observes the
request-wide total once the handler returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:59:11 -08:00
..
2024-07-04 11:00:41 -07:00

see https://blog.aqwari.net/xml-schema-go/

1. go get aqwari.net/xml/cmd/xsdgen
2. Add EncodingType element for ListBucketResult in AmazonS3.xsd
3. xsdgen -o s3api_xsd_generated.go -pkg s3api AmazonS3.xsd
4. Remove empty Grantee struct in s3api_xsd_generated.go
5. Remove xmlns: sed s'/http:\/\/s3.amazonaws.com\/doc\/2006-03-01\/\ //' s3api_xsd_generated.go