New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better task balancing #1482

Merged
merged 73 commits into from Jun 8, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+11 鈭11
Diff settings

Always

Just for now

Viewing a subset of changes. View all

increase tolerance -- shift log func up

  • Loading branch information...
darcatron committed May 26, 2017
commit c34834e56432132d05f369d4e42c574b2861ee22
@@ -376,7 +376,7 @@ private double calculateScore(double longRunningMemUsedScore, double memFreeScor
private double getScoreTolerance() {
double minTolerance = 0.10;
return Math.max(-0.09 * Math.log10(0.00026 * Math.max(usageManager.getNumSlavesWithUsage(), 1)), minTolerance);
return Math.max(-0.10 * Math.log10(0.00026 * Math.max(usageManager.getNumSlavesWithUsage(), 1)), minTolerance);
}
private double getMaxOfferAttemptsPerTask() {
@@ -298,39 +298,39 @@ public void itGetsTheCorrectMinScore() {
// no attempts, no delay, no utilization
setUtilization(0L, 1L, 0.00, 1.00);
addOrUpdateOfferMatchAttempt(taskId, 0);
assertScoreIs(0.677, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
assertScoreIs(0.641, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
// no attempts, delay, no utilization
assertScoreIs(0.577, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(30)));
assertScoreIs(0.541, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(30)));
// attempts, no delay, no utilization
addOrUpdateOfferMatchAttempt(taskId, 10);
assertScoreIs(0.177, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
assertScoreIs(0.141, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
// attempts, delay, no utilization
assertScoreIs(0.127, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
assertScoreIs(0.091, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
addOrUpdateOfferMatchAttempt(taskId, 1);
assertScoreIs(0.577, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
assertScoreIs(0.541, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
addOrUpdateOfferMatchAttempt(taskId, 4);
assertScoreIs(0.427, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
assertScoreIs(0.391, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
// no attempts, no delay, utilization
setUtilization(2L, 5L, 2.00, 10.00);
addOrUpdateOfferMatchAttempt(taskId, 0);
assertScoreIs(0.357, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
assertScoreIs(0.321, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
// no attempts, delay, utilization
assertScoreIs(0.307, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
assertScoreIs(0.271, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
// attempts, no delay, utilization
addOrUpdateOfferMatchAttempt(taskId, 2);
assertScoreIs(0.257, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
assertScoreIs(0.221, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now));
// attempts, delay, utilization
addOrUpdateOfferMatchAttempt(taskId, 2);
assertScoreIs(0.207, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
assertScoreIs(0.171, scheduler.minScore(taskRequest, offerMatchAttemptsPerTask, Optional.of(utilization), now + TimeUnit.SECONDS.toMillis(15)));
}
private void assertScoreIs(double expectedScore, double actualScore) {
ProTip! Use n and p to navigate between commits in a pull request.