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
Post a Comment