Menu

The 49-Byte Field That Doubles Our SQS Bill
📰

The 49-Byte Field That Doubles Our SQS Bill

DEV Community: cloud·vadim albarov·1 day ago
#1qfb7pYJ
#devtocloud#devto#dev#message#bytes
Reading 0:00
15s threshold

TL;DR: Amazon SQS does not bill per message. It bills per request , and every 64 KiB chunk of payload counts as one request. A message of 65,536 bytes is one request. A message of 65,537 bytes is two. If your producer packs messages tightly under that line (a lot of chunkers do exactly this, on purpose), then adding a harmless traceId to the envelope doubles the billed requests for every send and every receive, and the total SQS bill goes up 67% to 95% depending on how you delete. Every price here comes from the AWS pricing page; the scenario is invented to show the mechanism. Here is how the cliff works, how to see whether you are standing on it, and how to make it a slope instead.

The rule nobody re-reads

The SQS pricing page has one sentence that matters here:

Each 64 KB chunk of a payload is billed as 1 request.

The example right below it says a 1 MiB payload is billed as 16 requests. 16 × 65,536 = 1,048,576, so "64 KB" means 64 KiB and the chunk is 65,536 bytes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.