taskd.pl: add throttling support
Throttle "class"es are now supported. For each "class" the
maximum number of processes in the class can be configured as well
as the maximum number of concurrently executing processes in the
class.
In the past taskd.pl has only supported at most one new connection
per second, but if those were long running clones after 300 seconds,
300 clones could be in simultaneous operation. Not any more.
Similarly with ref updates, only one new ref update could be forked
per second. However, if it took longer than one second to process
any one ref update, multiple ref updates could end up going out
simultaneously.
With the advent of multiple refs all-at-once (ref-changes), the
situation becomes similar to that of clone if each update has
300 ref changes to process, after 300 seconds, 300 ref updates
could be going out per second. Not any more.
By default, at most one ref update will be sent out per second
no matter how long it takes to generate the update or how many
ref changes arrive in the meanwhile.
Similarly clones are also throttled but a small number are allowed
to be active simultanously.
Support for arbitrary throttle classes is present (via the taskd
socket), but other parts of Girocco will need to be modified to
make use of the throttle facility for it to be meaningful.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>