travis-ci/travis-core — pull request #86 by svenfuchs (2012-07-29 15:13:55+00:00)
Title: refactor worker heartbeat

deployed in production right now, no performance drops

Job queueing is currently happening on worker heartbeats, happening per
worker and only enqueues a single job per worker/queue. This change
makes it so that worker heartbeats and job queueing happen separately
again.

Worker heartbeats are now "batched" as much as possible (e.g. there's
only one DB query happening for setting the :last_seen_at attribute).

Job queueing now happens based on a separate interval not depending on
the worker heartbeat. This way it also won't iterate over each worker
which just became "ready" but instead enqueues all jobs that may be
queued according to the rate limits in one go.

That also means that it does not go through the worker event handler any
more, making the whole thing less complicated.

The current interval for checking for queueable jobs is 3 seconds. The
current worker heartbeat interval is 5 seconds.