Latency of upload a file and download it from s3

0

Hey team we are building a service where we are consuming a step function which have 3 apis. We have to pass json files to other apis but the file might be large and there is a limit of 256KB in step function. So we were thinking of two approaches:

  1. Upload it to S3 and download it via S3. In this can we know what are the latency we are talking about in uploading and downloading in context of file size?
  2. Using an ElastiCache that will store the data until the step function runs and what will be the latency in this case in context to the file size? Also is there any standard way to handle these use case if the limit of input and output size is more than 256kb?
1 Answer
0

For S3, if your comparison is ElastiCache, you will want to consider S3 Express One Zone, which provides the lowest latency option in S3. In discussing latency, you want to think about transmission time and server time.

Server Time can be tracked by FirstByteLatency. The best way to track full round trip latency will be through client side metrics. S3 provides a metric TotalRequestLatency that tracks this from the server side, but realize some aspects of this aren't tracked, like establishing a TCP connection, any client side queuing, etc.

Transmission time for 256KB will be a low number, but the exact details will depend upon your networking, but a reasonable expectation might be single digit ms. In S3 Standard a single connection can deliver 85-90MBs which is about 2.5ms for 256KB.

For the overall requests, with S3 Standard you should budget more than 10ms, with S3 Express One Zone you may be able to budget less than 10ms per request. S3 Express One Zone provides consistent single digit FirstByteLatency, but for your application, you'll need to consider that transmission time, any network latency, and any effect your own code introduces. I'd suggest testing to validate all aspects of your design, but those are some rough starting points. Another advantage of S3 Express One Zone is that latency is also more predictable, as in tail latencies are lower.

If you're looking to dive deeper here I'd suggest this presentation from re:Invent 2023, Deep dive on Amazon S3 Express One Zone storage class (STG230).

profile pictureAWS
answered 4 months ago
profile picture
EXPERT
reviewed 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions