[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] http client throttle



Hi Mark, and thank you for your suggestion. Are you aware of any example code that uses this technique to dynamically throttle requests? I've looked at the bufferevent rate limit options but it looks more bandwidth oriented and static in nature.Â

On a second thought. Why is libevent http returning NULL requests with 36 Operation now in progress errors to me? I have set connection to unlimited retry so I thought it would deal with these issues (and throttle appropriately in case the server can not handle and returns errors).

Am I really supposed to have to deal with these issues?

On Mon, Jul 20, 2015 at 9:06 AM, Mark Ellzey <mthomas@xxxxxxxxxx> wrote:
You can either set a timer to ease up the requests/s, or use the rate-limiting functionality.Â
Use "struct buffer event * evhttp_connection_get_bufferevent", and read the section on
on this api here:Â
http://www.wangafu.net/~nickm/libevent-book/Ref6a_advanced_bufferevents.html

On Sun, Jul 19, 2015 at 3:30 AM Jesper Lundgren <koudelkaa@xxxxxxxxx> wrote:
Hello, I am using libevent http in client mode to send GET requests. Many of the requests I try to send end with http_req_done callbacks where req == NULL and socket error is set to 36 (Operation now in progress). My guess is that the server can not handle the traffic but I am not sure what is the best approach to dynamically adjust the request rate in libevent to prevent socket errors.

Any suggestions?

/JL