> For the complete documentation index, see [llms.txt](https://karansingh.gitbook.io/tutorialsdojo-wrong-answers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://karansingh.gitbook.io/tutorialsdojo-wrong-answers/test-5-72/sqs-short-and-long-polling.md).

# SQS short and long polling

* **By default, queues use short polling**.<br>
* **Short polling:**
  * **`ReceiveMessage` request queries only a subset of the servers** (based on a weighted random distribution) to find messages that are available to include in the response.
  * **Sends the response right away**, even if the query found no messages.<br>
* **Long polling:**
  * **`ReceiveMessage` request queries all of the servers for messages**
  * **Sends a response after it collects at least one available message**, up to the maximum number of messages specified in the request.
  * When the **wait time for the `ReceiveMessage` API action is greater than 0**.
  * **Helps reduce the cost of using SQS by eliminating the number of empty responses and false empty responses**.
