Recent AWS Customer Success Stories & Videos

More AWS Customer Success Stories...

« The Amazon EC2 Spotathon | Main | The AWS Report - Ramesh Panuganty of Cognizant »


TrackBack URL for this entry:

Listed below are links to weblogs that reference Amazon SQS - Long Polling and Request Batching / Client-Side Buffering :


Feed You can follow this conversation by subscribing to the comment feed for this post.

Jonathan Jørgensen

This is absolutely great!

Why only 20 seconds? This limit is annoyingly low. Why not let people choose a longer limit, lets say 90 seconds?

It's not a problem if you only have 1 queue, but more complex infrastructures rely on many queues.


I would assume the 20 seconds represents their tradeoff between the functionality and scalability of the solution. Remember that with long polling, their servers have to maintain open TCP connections for the duration of the poll. Since TCP connections are not an unlimited resource, they have to draw the line somewhere.

Little's Law is instructive here:'s_law
"Little's Law tells us that the average number of customers in the store L, is the effective arrival rate λ, times the average time that a customer spends in the store W, or simply: L=λW"

So for a fixed arrival rate (request to open a polling connection) and a fixed number of available TCP connections per server (L), if you increase W by leaving the connections open longer, you run out of capacity sooner.

Put another way:

Yo dawg, I heard you like queues, so we put some queuing theory in your queue so you can calculate while you wait.

The comments to this entry are closed.

Featured Events

The AWS Report

Brought to You By

Jeff Barr (@jeffbarr):

Jinesh Varia (@jinman):

Email Subscription

Enter your email address:

Delivered by FeedBurner

April 2014

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30