Use Redis to track concurrent outbound HTTP requests -



Use Redis to track concurrent outbound HTTP requests -

i'm little new redis, i'd see if can used maintain track of how many concurrent http connections i'm making.

here's high level plan:

incr requests // request begins http.get(...) // request ends decr.requests

then @ point, phone call get requests see how many open.

the ultimate goal here throttle http requests remain below arbitrary amount, 50 requests/s.

is right way it? there pitfalls?

as pitfalls, 1 can see server goes downwards or loses connection redis mid-request may never phone call decr.

since don't know server request, can never reset count right value without bringing scheme halt , reset 0.

redis

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

How do you set up a perforce server to work over the internet? -

ios - Lagging ScrollView with UIWebview inside -