I've been wondering, is there a technology that relays (slows down) responses to a given IP according to the rate It makes requests?
E.g I have an apache server with a "heavy" API service that I want to limit to 1 request/2 seconds/IP if the server is not 100% loaded or a "fair usage" policy if the server is fully loaded. Optionally I would like to promote specific calls with specific ids e.g. /req.php?id=157 with a "bonus rate" of e.g. 10 req/second.
Also if someone exceeds e.g. 100 requests/hour he will be prompted with an error response prompting him to upgrade etc.
For me this sounds like a common requirement in many systems and I would expect there to be some relevant frameworks. Are you aware of any in php,python,java or even as an apache module?