taskd.pl: eliminate main loop sleep 1 delay
commit95e31929e8fe3cf06eb8ee2b36082ad0b1656129
authorKyle J. McKay <mackyle@gmail.com>
Wed, 7 Oct 2015 04:04:14 +0000 (6 21:04 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 7 Oct 2015 04:04:14 +0000 (6 21:04 -0700)
treefd1cf569c4a70a235119fdd2e9f7614ba3d2cd2f
parent41873d90a7528f76794b64253bef7efd63419e87
taskd.pl: eliminate main loop sleep 1 delay

Implement a penalty box system where by accept is skipped whenever
the current number of penalty points exceeds a spawning threshold.

The current number of penalty points is increased by one whenever
a new process is spawned and decreased by one as each second passes.

This preserves the previous of accepting no more than one new
connection per second but changes it to no more than one new
connection per second on average while allowing bursts of up to
eight new connections at once.

This improves responsiveness and allows the pipe messages to be
serviced more frequently while avoiding excessive spawning.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
taskd/taskd.pl