I'm creating a site with a large number of small tools. One is a tool which uses a Python cgi-script that interacts with the Natural Language Toolkit (nltk), which is disk and CPU intensive. I have other services that are less intensive.
I will also have a firewall that blocks abusive IPs making eminence requests. I would like this to return a simple 429 response with an empty JSON object as the body.
I would also like to include other rules in this, like a 30 second receive-to-transmit time, else close the connection.
How can I implement this in a lighttpd server on Debian?