- Newest
- Most votes
- Most comments
The reason why the "Number Of Messages Sent" metric is showing a count of 10 instead of 1 is because you are sending 10 messages in 1 batch using the AmazonSQSBufferedAsyncClient. From the perspective of the SQS service, this is considered as 10 separate messages being sent, even though they are being sent together in a batch.
Amazon SQS offers a reliable, highly-scalable hosted queue for storing messages as they travel between applications or microservices. When you send a message to an SQS queue, the message is stored redundantly across multiple servers in multiple data centers to ensure high availability and durability. The messages are not stored in a traditional database, but rather in a distributed storage service that is optimized for storing large numbers of messages with high availability and durability. Note that SQS messages have a maximum storage size of 256 kb and a maximum storage time of 14 days.
Relevant content
- Accepted Answerasked 6 months ago
- Accepted Answerasked 6 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
How AWS SQS does charge/bill for a batch request? How can I monitor the number of API requests on a daily basis(on that bill generated)? As per this link(https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-client-side-buffering-request-batching.html), Batch request cost is lower than single-single messages.
Every xxx KB segment incurs a single charge. Therefore, we can accumulate messages and send them out as a single request to SQS when we reach the xxx KB limit. This means we send, receive, or delete multiple messages in a single request, reducing the total number of requests and therefore lowering costs. Batches: Send, receive, or delete messages in batches of up to 10 messages or 256KB. Batches cost the same amount as single messages, meaning SQS can be even more cost effective for customers that use batching.
NumberOfMessagesSent is the metric that measures the number of messages added to a queue.
I am sending messages in batches and the total payload of messages(all messages in batch) is less than 256kb. But still, I am seeing the "Number Of Messages Sent" metric is showing 10. How can I verify AWS is charging on 1 request, not on 10 requests? I wanted to see how many API requests happening for one batch request. "Number of Messages sent" metric means the number of API calls that happen to send messages. If "Number Of Messages Sent" metric is showing 10, that mean AWS will charge me for 10 API calls?
The metric "Number of Messages sent" is exactly what you described: the number of messages published to the queue, regardless of whether they were sent individually or in batches. If your goal is to monitor the number of API operations in an SQS queue and therefore understand how much you will be billed, you can access the Cost Explorer and filter by "Group by": "API operation" and select "Service": "SQS". This will allow you to determine the number of API operations in your SQS queue and its associated cost.