CGI Throttler
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


AOV CGI Throttler

This is a program to be used as a front-end for CGIs that keeps track
of simultaneous connections and starts generating 503 Service Unavaiable
HTTP errors if a specified threshold is overpassed.


Say you have a CGI named g.cgi, with its first line being


Rename it to g2.cgi, and create a new CGI stub called g.cgi containing

 exec /usr/local/bin/aov-cgi-thr ${REMOTE_ADDR} /usr/bin/python g.cgi

This way aov-cgi-thr keeps account of each connection and, if the
default maximum number of simultaneous connections per IP is overpassed
(changeable by using the -m command line option), it returns immediately
with an HTTP 503 error. Otherwise, the CGI is called as always.

A time window and other options are configurable; execute the program
with no arguments to see them. The log file is kept by default under
the lighttpd log folder, so you probably want to change it if you use
a different web server.

Released under the public domain by Angel Ortega, <>