How to throttle HTTP requests?

There is an erlang library for load regulation that I have used in the past.

At the simplest case you can start a job queue which will only allow a specific amount of requests per second. It doesn’t use any external dependencies.

At its simplest:

> jobs.add_queue(:myqueue, [{:standard_rate, 10}])
> jobs.run(:myqueue, fn -> :httpc.request('https://www.elixirforum.com') end)

Runs the jobs at a rate of 10 per second at most

4 Likes