taskd.pl: add throttling support
commit0a427c1a1363186321371b0d823ebf6a89c3c3de
authorKyle J. McKay <mackyle@gmail.com>
Wed, 30 Sep 2015 13:16:28 +0000 (30 06:16 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 30 Sep 2015 13:16:28 +0000 (30 06:16 -0700)
treead97fe05cfdfdc98a6d8db1e2016ad44a93daf7b
parentc1379bc6043cb7d9d434449997e04b9dd5f15c63
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>
Girocco/Config.pm
taskd/taskd.pl