Stacked bars showing DNS, TLS, body upload, and regional storage wait times

When an application experiences sluggish upload performance to an S3-compatible bucket, developers usually suspect network round-trips: slow DNS lookups, cross-continental TCP handshakes, or heavy TLS negotiations. Teams spend days tweaking resolver caches, switching TLS ciphers, or implementing HTTP/3 in pursuit of lower upload latencies.

In reality, connection setup is rarely where PUT latency goes. We instrumented 198 authenticated S3 PUT requests across Europe, the US, and India against regional bucket stores, opening a brand-new TCP and TLS connection for every single upload. Decomposing each phase with curl write-out variables revealed that network connection setup accounted for less than 15% of total request duration. The vast majority of time went into server-side storage persistence acknowledgement (TTFB).

How to measure S3 PUT phases with curl

Curl provides native AWS SigV4 signing support (<code>--aws-sigv4</code>). Combined with format variables (<code>-w</code>), you can decompose an authenticated S3 upload into exact discrete steps without installing heavy benchmarking frameworks:

bash
# Measure exact S3 PUT lifecycle timings using curl and AWS SigV4
curl -s -w "\
  DNS Lookup:       %{time_namelookup} s\n\
  TCP Connect:      %{time_connect} s\n\
  TLS Handshake:    %{time_appconnect} s\n\
  Pre-Transfer:     %{time_pretransfer} s\n\
  Start Transfer:   %{time_starttransfer} s\n\
  Total Duration:   %{time_total} s\n" \
  -X PUT \
  --aws-sigv4 "aws:amz:auto:s3" \
  --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" \
  -H "x-amz-content-sha256: UNSIGNED-PAYLOAD" \
  --data-binary @upload.bin \
  "https://s3.tport.space/my-bucket/upload.bin"
  • TCP Connect: time_connect - time_namelookup
  • TLS Handshake: time_appconnect - time_connect
  • Upload Transmission: time_pretransfer until the socket finishes transmitting the payload
  • Storage Wait (TTFB): time_starttransfer - time_pretransfer. This measures the pause after your client has finished sending the bytes until the S3 gateway returns the first byte of HTTP 200.

The numbers: same-region vs cross-region

The table below lists the median phase timings for 64 KiB PUT requests executed across three client regions writing to regional bucket stores. Every request opened a fresh TLS connection and verified the response ETag against the MD5 of the payload:

Client → Bucket StoreConnect + TLSBody UploadStorage Wait (TTFB)64 KiB Median (p90)
Europe → Europe Store (Same-Region)~60 ms< 15 ms159 ms0.327 s (0.642 s)
Europe → US Store (Cross-Region)~60 ms< 15 ms448 ms0.592 s (0.872 s)
US → US Store (Same-Region)~40 ms< 12 ms259 ms0.418 s (0.788 s)
US → Europe Store (Cross-Region)~40 ms< 12 ms513 ms0.740 s (1.377 s)
India → Europe Store~40 ms< 15 ms1,259 ms1.486 s (2.141 s)
India → US Store~40 ms< 15 ms1,006 ms1.445 s (2.748 s)

Key findings from the 64 KiB upload decomposition:

  • Same-region writes are 2-3x faster: Europe clients writing to a Europe bucket achieved a median of 0.327 s, while US clients writing to a US bucket achieved 0.418 s.
  • Cross-region transit adds direct storage wait: Writing across regions (Europe client to US bucket or US client to Europe bucket) increased 64 KiB medians to 0.592-0.740 s. The extra ~300-500 ms landed entirely in the storage acknowledgement step.
  • No "fast from anywhere" magic: Clients located in regions without a local bucket store (such as India writing to Europe or US buckets) took ~1.45-1.49 s. Even though edge TLS negotiation completed in ~40 ms, the storage commit had to cross the WAN, pushing storage TTFB past 1,000 ms.

Payload scaling: 64 KiB, 1 MiB, and 16 MiB

How does payload size affect the balance between network transfer and storage acknowledgement? We tested 11 rounds across three payload sizes of incompressible data:

Client → Bucket Store64 KiB Median1 MiB Median16 MiB MedianDominant Latency Factor
Europe → Europe Store0.327 s0.456 s1.373 sStorage TTFB for small files; bandwidth > 1 MiB
Europe → US Store0.592 s0.723 s2.167 sCross-region transit + transfer bandwidth
US → US Store0.418 s0.602 s1.827 sStorage TTFB for small files; bandwidth > 1 MiB
US → Europe Store0.740 s0.926 s1.799 sCross-region transit + transfer bandwidth
India → Europe Store1.486 s2.052 s3.392 sWAN transit + transfer bandwidth
India → US Store1.445 s2.116 s4.042 sWAN transit + transfer bandwidth

For small objects (under 1 MiB), total latency is almost completely governed by the time it takes the storage backend to replicate and acknowledge the write. For 16 MiB payloads, network throughput becomes significant (1.37-1.83 s in-region vs 1.8-2.2 s cross-region), but proximity to the bucket store remains the primary differentiator.

The architectural lesson: pick the bucket region next to your writers

What these measurements mean when architecting applications around object storage:

  • Co-locate write-heavy services: If an API or worker service frequently uploads small files, place your storage bucket in the same region as those worker instances. In our tests, same-region writes finished in 0.33-0.42 s compared to 0.59-0.74 s across regions.
  • Edge TLS termination does not accelerate writes: Connecting to an edge gateway near the client terminates TCP and TLS in tens of milliseconds, but an S3 PUT is strongly consistent. The gateway cannot return HTTP 200 until the object is durably committed to the target bucket region.
  • Reuse HTTP connections under load: Persistent connection pooling eliminates the initial 40-70 ms handshake on every request, ensuring subsequent PUTs jump straight to data transfer and storage commit.
  • Instrument TTFB directly: When debugging upload performance, monitor time_starttransfer - time_pretransfer. If connection setup is 40 ms and total duration is 800 ms, tuning DNS or TLS ciphers will yield no measurable improvement.

To eliminate client-side connection overhead completely, S3 client connection pooling benchmarks covers persistent socket reuse across Python urllib3, aiohttp, and Go net/http.

High-performance S3-compatible storage with regional bucket stores, predictable latencies, and zero egress fees.

Explore tport.space

Test record and sources