-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better Scheduling/Load Balancing for activities (#52)
* Add random scheduler * add loadmonitor component * add scheduling options & filehash tweaks * keep partition prefix consistent with all the other tracing * fix bug (failed to update estimated load when remote activities complete) * Add aggresive scheduler mode * fixed a typo * basic load monitor * checkpoint * fix bug in ETW tracing * change conditions for load monitor reporting * use full tracing * trace more information for OffloadCommandReceived * change tracing of task messages to provide more consistent results * several package updates, including DurableTask.Core 2.5.6 * update to account for tracing changes * remove load monitor interval and add idle message * add latency field to ActivityCompleted and RemoteActivityResultReceived * added offload algorithms based on waiting time * fix overflow in filehash * fixes to loadmonitor logic, autoscaler, and temporary info sender * fix missing file and update scale tracing * change loadmonitor hosting so it moves less often * implement overlay of pending commands on offload estimation * improve precision of load estimation and distinguish between stationary and mobile. * remove unnecessary left over line of code. * replace push based algo with pull based * fix so we don't pull more than mobile * fix dumb mistake * fix formula * need more conservative default estimate for completion time, otherwise offload is too aggressive * remove unnecessary constants. * add tracing for RTT * tweak parameters for RTT and smoothing * batchworker tracing for senders * use array instead of dictionary, fix concurrent modification exception * revise sender for load monitor events to send only latest state, and to do rate limiting * fix tracing * turn off all loadmonitor activity when the parameter ActivityScheduler is not set LoadMonitor * implemented "Static" setting for ActivityScheduler * reduce severity of tracing in loadmonitor * make filehash scale configurable * update names, remove old algorithms * improve terminology and implement solicitation * fixes and simplifications * minor updates * simplify data structure for local activities * use smarter concurrency defaults, same as for default backend * fix tracing in LoadMonitor * update filehash a bit to make it more uniform * add test series for comparing local vs locavore Co-authored-by: Sebastian Burckhardt <sburckha@microsoft.com>
- Loading branch information
1 parent
9c8e0d3
commit 6b3b372
Showing
57 changed files
with
1,765 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/DurableTask.Netherite/Events/LoadMonitorEvents/LoadInformationReceived.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace DurableTask.Netherite | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
|
||
[DataContract] | ||
class LoadInformationReceived : LoadMonitorEvent | ||
{ | ||
[DataMember] | ||
public uint PartitionId { get; set; } // The partition that sent the load information | ||
|
||
[DataMember] | ||
public int Stationary { get; set; } // The number of queued activities that can only execute on this partition | ||
|
||
[DataMember] | ||
public int Mobile { get; set; } // The number of queued activities that are available for transfer | ||
|
||
[DataMember] | ||
public double? AverageActCompletionTime { get; set; } | ||
|
||
[DataMember] | ||
public DateTime[] TransfersReceived { get; set; } | ||
|
||
public bool ConfirmsSource(TransferCommandReceived cmd) | ||
{ | ||
uint source = cmd.PartitionId; | ||
DateTime id = cmd.Timestamp; | ||
|
||
return | ||
source == this.PartitionId | ||
&& this.TransfersReceived != null | ||
&& this.TransfersReceived[source] >= id; | ||
} | ||
|
||
public bool ConfirmsDestination(TransferCommandReceived cmd) | ||
{ | ||
uint source = cmd.PartitionId; | ||
uint destination = cmd.TransferDestination; | ||
DateTime id = cmd.Timestamp; | ||
|
||
return | ||
destination == this.PartitionId | ||
&& this.TransfersReceived != null | ||
&& this.TransfersReceived[source] >= id; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/DurableTask.Netherite/Events/LoadMonitorEvents/LoadMonitorEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace DurableTask.Netherite | ||
{ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
[DataContract] | ||
abstract class LoadMonitorEvent : Event | ||
{ | ||
[DataMember] | ||
public Guid RequestId { get; set; } | ||
|
||
public override EventId EventId => EventId.MakeLoadMonitorEventId(this.RequestId); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...bleTask.Netherite/Events/PartitionEvents/External/FromLoadMonitor/SolicitationReceived.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace DurableTask.Netherite | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using DurableTask.Core; | ||
|
||
[DataContract] | ||
class SolicitationReceived : PartitionMessageEvent | ||
{ | ||
[DataMember] | ||
public Guid RequestId { get; set; } | ||
|
||
[DataMember] | ||
public DateTime Timestamp { get; set; } | ||
|
||
public override EventId EventId => EventId.MakeLoadMonitorToPartitionEventId(this.RequestId, this.PartitionId); | ||
|
||
public override IEnumerable<(TaskMessage message, string workItemId)> TracedTaskMessages => throw new NotImplementedException(); | ||
|
||
public override void DetermineEffects(EffectTracker effects) | ||
{ | ||
effects.Add(TrackedObjectKey.Activities); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...Task.Netherite/Events/PartitionEvents/External/FromLoadMonitor/TransferCommandReceived.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace DurableTask.Netherite | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using DurableTask.Core; | ||
|
||
[DataContract] | ||
class TransferCommandReceived : PartitionMessageEvent | ||
{ | ||
[DataMember] | ||
public Guid RequestId { get; set; } | ||
|
||
[DataMember] | ||
public int NumActivitiesToSend { get; set; } | ||
|
||
[DataMember] | ||
public uint TransferDestination { get; set; } | ||
|
||
[DataMember] | ||
public DateTime Timestamp { get; set; } | ||
|
||
[IgnoreDataMember] | ||
public List<(TaskMessage, string)> TransferredActivities { get; set; } | ||
|
||
public override EventId EventId => EventId.MakeLoadMonitorToPartitionEventId(this.RequestId, this.PartitionId); | ||
|
||
public override IEnumerable<(TaskMessage message, string workItemId)> TracedTaskMessages => throw new NotImplementedException(); | ||
|
||
public override void DetermineEffects(EffectTracker effects) | ||
{ | ||
effects.Add(TrackedObjectKey.Activities); | ||
} | ||
|
||
protected override void ExtraTraceInformation(StringBuilder s) | ||
{ | ||
base.ExtraTraceInformation(s); | ||
|
||
s.Append(this.NumActivitiesToSend); | ||
s.Append("->Part"); | ||
s.Append(this.TransferDestination.ToString("D2")); | ||
} | ||
} | ||
} |
Oops, something went wrong.