Add per-partition JobQueueRedis aggregation
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 12 Nov 2015 00:10:29 +0000 (16:10 -0800)
committerOri.livneh <ori@wikimedia.org>
Thu, 10 Dec 2015 23:59:59 +0000 (23:59 +0000)
commit6fe2f48df70e63cc0af1e2c100d2a5b10a6c6f71
treef28819b37a68df395a4169999009ebfa0bab30b8
parentea838e7899a2cb12701c49b865755895947e8210
Add per-partition JobQueueRedis aggregation

* Track queues with non-abandoned jobs per partition server.
  The s-queuesWithJobs key can easily be queried to see which
  queues need to have periodic tasks run (or for debugging).
* This is requirement for the redis jobchron service to be able to
  avoid hitting N=(no. types X no. wikis) queues for periodic tasks
  when only a tiny fraction of those actually have any jobs. For WMF,
  there are over 30K queues, most of them empty, so doing that can help
  lower redis-server CPU (or at least make jobchron more responsive).
* This also allows for jobchron to manage the aggregator by taking the
  per-server aggregator sets and merging them. This scales much better
  as there are only a modest number of these daemons (18 for WMF) but
  vastly more web thread pushing jobs. This cuts down on the connections
  to the active aggregator server (the one with the hash table).
* Use Lua unpack() more for stylistic consistency.

Change-Id: I1549f0edc78cc4004dd887b475dec4c0ebd306c6
includes/jobqueue/JobQueueRedis.php
tests/phpunit/includes/jobqueue/JobQueueTest.php