Homec4science

Improve taskmaster behavior on empty queues

Authored by epriestley <git@epriestley.com> on Feb 16 2015, 20:30.

Description

Improve taskmaster behavior on empty queues

Summary:
Right now, taskmasters on empty queues sleep for 30 seconds. With a default setup (4 taskmasters), this averages out to 7.5 seconds between the time you do anything that queues something and the time that the taskmasters start work on it.

On instances, which currently launch a smaller number of taskmasters, this wait is even longer.

Instead, sleep for the number of seconds that there are taskmasters, with a random offset. This makes the average wait to start a task from an empty queue 1 second, and the average maximum load of an empty queue also one query per second.

On loaded instances this doesn't matter, but this should dramatically improve behavior for less-loaded instances without any real tradeoffs.

Test Plan: Started several taskmasters, saw them jitter out of sync and then use short sleeps to give an empty queue about a 1s delay.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11772

Details

Committed
epriestley <git@epriestley.com>Feb 16 2015, 20:30
Pushed
aubortJan 31 2017, 17:16
Parents
rPH3a8cd60bab41: When cluster.instance is defined, use it to namespace S3 objects
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH2cd77b5b5817: Improve taskmaster behavior on empty queues (authored by epriestley <git@epriestley.com>).Feb 16 2015, 20:30