hydra-queue-runner: More accurate memory accounting
[?]
Nov 16, 2016, 4:46 PM
YNO7CQ6P56YQP7UMGQFL4AZED7DBXE32U7TI6OMOKT6GMWZDMWWQCDependencies
- [2]
MQNJPMCUFix bad format string - [3]
BYVRA54QTemporarily disable machines on any exception, not just connection failures - [4]
MB3TISH2Rate-limit the number of threads copying closures at the same time - [5]
BG6PEOB2Make the output size limit configurable - [6]
SL3WSRAChydra-queue-runner: Limit memory usage - [*]
5AIYUMTBBasic remote building - [*]
UVNTWTWGPrevent download of NARs we just uploaded - [*]
MHVIT4JYSplit hydra-queue-runner.cc more - [*]
HJOEIMLRRefactor - [*]
N4IROACVMove buildRemote() into State
Change contents
- replacement in src/hydra-queue-runner/build-remote.cc at line 376
available. FIXME: only need this for binary cachedestination stores. */available, which is twice the NAR size (namely theuncompressed and worst-case compressed NAR), plus 150MB for xz compression overhead. (The xz manpage claims~94 MiB, but that's not was I'm seeing.) */ - replacement in src/hydra-queue-runner/build-remote.cc at line 381
auto memoryReservation(memoryTokens.get(totalNarSize));size_t compressionCost = totalNarSize + 150 * 1024 * 1024;result.tokens = std::make_unique<nix::TokenServer::Token>(memoryTokens.get(totalNarSize + compressionCost)); - edit in src/hydra-queue-runner/build-remote.cc at line 396
/* Release the tokens pertaining to NARcompression. After this we only have the uncompressedNAR in memory. */result.tokens->give_back(compressionCost); - edit in src/hydra-queue-runner/builder.cc at line 182
result.accessor = 0;result.tokens = 0; - edit in src/hydra-queue-runner/state.hh at line 53[12.1810][9.442]
std::unique_ptr<nix::TokenServer::Token> tokens; - edit in src/hydra-queue-runner/token-server.hh at line 43
debug("acquiring %d tokens", tokens); - replacement in src/hydra-queue-runner/token-server.hh at line 58
Token(Token && t) : ts(t.ts) { t.ts = 0; }Token(Token && t) : ts(t.ts), tokens(t.tokens), acquired(t.acquired){t.ts = 0;t.acquired = false;} - edit in src/hydra-queue-runner/token-server.hh at line 68
give_back(tokens);}bool operator ()() { return acquired; }void give_back(size_t t){debug("returning %d tokens", t);if (!t) return;assert(acquired);assert(t <= tokens); - replacement in src/hydra-queue-runner/token-server.hh at line 81
assert(*inUse >= tokens);*inUse -= tokens;assert(*inUse >= t);*inUse -= t;tokens -= t; - replacement in src/hydra-queue-runner/token-server.hh at line 85
ts->wakeup.notify_one();// FIXME: inefficient. Should wake up waiters that can// proceed now.ts->wakeup.notify_all(); - edit in src/hydra-queue-runner/token-server.hh at line 90
bool operator ()() { return acquired; }