hydra/src/hydra-queue-runner
Eelco Dolstra 9127f5bbc3 hydra-queue-runner: Limit memory usage
When using a binary cache store, the queue runner receives NARs from
the build machines, compresses them, and uploads them to the
cache. However, keeping multiple large NARs in memory can cause the
queue runner to run out of memory. This can happen for instance when
it's processing multiple ISO images concurrently.

The fix is to use a TokenServer to prevent the builder threads to
store more than a certain total size of NARs concurrently (at the
moment, this is hard-coded at 4 GiB). Builder threads that cause the
limit to be exceeded will block until other threads have finished.

The 4 GiB limit does not include certain other allocations, such as
for xz compression or for FSAccessor::readFile(). But since these are
unlikely to be more than the size of the NARs and hydra.nixos.org has
32 GiB RAM, it should be fine.
2016-03-09 14:30:13 +01:00
..
build-remote.cc hydra-queue-runner: Limit memory usage 2016-03-09 14:30:13 +01:00
build-result.cc Support hydra-build-products on binary cache stores 2016-02-26 14:45:03 +01:00
build-result.hh Support hydra-build-products on binary cache stores 2016-02-26 14:45:03 +01:00
builder.cc Get rid of "will retry" messages after "maybe cancelling..." 2016-03-08 13:09:39 +01:00
counter.hh Warn if PostgreSQL appears stalled 2016-02-29 15:10:30 +01:00
db.hh Namespace cleanup 2015-07-07 10:29:43 +02:00
dispatcher.cc Add some instrumentation to keep track of dispatcher cost 2016-03-02 14:18:39 +01:00
finally.hh Keep better bytesReceived/bytesSent stats 2016-02-26 16:17:05 +01:00
hydra-queue-runner.cc hydra-queue-runner: Limit memory usage 2016-03-09 14:30:13 +01:00
Makefile.am Fix Makefile.am 2016-02-26 19:54:55 +01:00
queue-monitor.cc Keep track of time required to load builds 2016-03-08 13:09:29 +01:00
s3-binary-cache-store.cc Some more logging 2016-03-08 13:08:07 +01:00
s3-binary-cache-store.hh Fix build 2016-03-04 17:51:32 +01:00
state.hh hydra-queue-runner: Limit memory usage 2016-03-09 14:30:13 +01:00
token-server.hh hydra-queue-runner: Limit memory usage 2016-03-09 14:30:13 +01:00