- Newest
- Most votes
- Most comments
(moving to AWS Lambda forum)
According to the feature announcement, calls to SQS made by the Lambda SQS poller will be billed to your account by SQS.
Kuba@AWS wrote:
According to the feature announcement, calls to SQS made by the Lambda SQS poller will be billed to your account by SQS.
From the linked blog post: "... the Lambda service will begin polling the SQS queue using five parallel long-polling connections."
Didn't realize a lambda trigger meant continuously long-polling the queue using at least five threads.
All is accounted for now: 5 connections, 20 sec per long poll => 900 req / hour => ~54k in ~60 hours.
Thanks a lot.
Hi,
It sounds like you are possibly seeing a higher than expected bill with SQS because you are using the default "Short Polling" instead of "Long Polling". If you have a single thread that is polling a single queue, you will definitely want to set the timeout to 20s (long polling), so that you are NOT making continuous requests to the SQS queue to see if there is data available. The default, 'Short polling' would ONLY make sense, if you have a single thread that has to poll multiple queues (thus, checking each queue for data quickly rather than spending 20s waiting for a message to arrive on a queue before moving on to check on the next queue for a message).
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html#sqs-long-polling
Long polling offers the following benefits:
- Eliminate empty responses by allowing Amazon SQS to wait until a message is available in a queue before sending a response. Unless the connection times out, the response to the ReceiveMessage request contains at least one of the available messages, up to the maximum number of messages specified in the ReceiveMessage action.
- Eliminate false empty responses by querying all—rather than a subset of—Amazon SQS servers.
- Return messages as soon as they become available.
This link has directions on how to setup Long Polling
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/working-with-messages.html#setting-up-long-polling
{code}
Hope this helps,
-randy
Relevant content
- Accepted Answerasked 2 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago