-
Notifications
You must be signed in to change notification settings - Fork 1k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streams TCP Transport with Hand-Written Protobuf Deserialization #4594
base: dev
Are you sure you want to change the base?
Changes from 24 commits
0cbffbf
d4e7c8e
a2217e2
52e931b
831d032
eb42e44
5c93ec5
0baec4f
20f7e82
72d8a5e
07f7128
c7a3e5e
173d15d
9e4f20e
08739f9
1efd76f
4b3d081
985bc11
e8551e5
1f5e9e4
3a98998
98b7e11
d04fbc1
ba46ce5
2be3022
f490009
3cfd7a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,11 @@ public static Config CreateActorSystemConfig(string actorSystemName, string ipOr | |
|
||
dot-netty.tcp { | ||
port = 0 | ||
hostname = ""localhost"" | ||
hostname = """" | ||
batching { | ||
enabled = true | ||
flush-interval = 40ms | ||
} | ||
} | ||
} | ||
}"); | ||
|
@@ -69,7 +73,14 @@ public static Config CreateActorSystemConfig(string actorSystemName, string ipOr | |
|
||
private static void Main(params string[] args) | ||
{ | ||
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; | ||
AppDomain.CurrentDomain.UnhandledException += (sender, eventArgs) => | ||
{ | ||
Console.WriteLine(eventArgs.ExceptionObject as Exception); | ||
Console.WriteLine("STACKOVERFLOW"); | ||
Console.WriteLine(sender); | ||
Console.WriteLine(eventArgs.ExceptionObject as Exception); | ||
}; | ||
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.AboveNormal; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably port that change back into a separate PR - good idea. edit: just to clarify - this change is so good and small that it should find its way into the |
||
uint timesToRun; | ||
if (args.Length == 0 || !uint.TryParse(args[0], out timesToRun)) | ||
{ | ||
|
@@ -82,7 +93,7 @@ private static void Main(params string[] args) | |
|
||
private static async void Start(uint timesToRun) | ||
{ | ||
const long repeat = 100000L; | ||
const long repeat = 50000L; | ||
|
||
var processorCount = Environment.ProcessorCount; | ||
if (processorCount == 0) | ||
|
@@ -116,9 +127,18 @@ private static async void Start(uint timesToRun) | |
var bestThroughput = 0L; | ||
foreach (var throughput in GetClientSettings()) | ||
{ | ||
var result1 = await Benchmark(throughput, repeat, bestThroughput, redCount); | ||
bestThroughput = result1.Item2; | ||
redCount = result1.Item3; | ||
try | ||
{ | ||
var result1 = await Benchmark(throughput, repeat, bestThroughput, redCount); | ||
bestThroughput = result1.Item2; | ||
redCount = result1.Item3; | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine(e); | ||
throw; | ||
} | ||
|
||
} | ||
} | ||
|
||
|
@@ -182,16 +202,18 @@ private static long GetTotalMessagesReceived(int numberOfClients, long numberOfR | |
throw new Exception("Received report that 1 or more remote actor is unable to begin the test. Aborting run."); | ||
} | ||
|
||
var rng = new Random(); | ||
var rand = new byte[2048]; | ||
rng.NextBytes(rand); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had this bit in here because it was interesting to note that some of my tweaks had to change when I started throwing messages a bit larger; If this number used passing this differs a LOT from smaller messages in ping-pong, changing some of the batching parameters (i.e. count, size) usually brings things back in-line. |
||
var sw = Stopwatch.StartNew(); | ||
receivers.ForEach(c => | ||
{ | ||
for (var i = 0; i < 50; i++) // prime the pump so EndpointWriters can take advantage of their batching model | ||
c.Tell("hit"); | ||
c.Tell("hi"); | ||
}); | ||
var waiting = Task.WhenAll(tasks); | ||
await Task.WhenAll(waiting); | ||
sw.Stop(); | ||
|
||
// force clean termination | ||
var termination = Task.WhenAll(new[] { system1.Terminate(), system2.Terminate() }).Wait(TimeSpan.FromSeconds(10)); | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,12 @@ | ||||||||||||||||||||
<Project Sdk="Microsoft.NET.Sdk"> | ||||||||||||||||||||
|
||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to reference For example: akka.net/src/contrib/persistence/Akka.Persistence.Sqlite/Akka.Persistence.Sqlite.csproj Lines 2 to 10 in 3705c8c
|
||||||||||||||||||||
<PropertyGroup> | ||||||||||||||||||||
<TargetFramework>netstandard2.0</TargetFramework> | ||||||||||||||||||||
</PropertyGroup> | ||||||||||||||||||||
|
||||||||||||||||||||
<ItemGroup> | ||||||||||||||||||||
<ProjectReference Include="..\..\..\core\Akka.Remote\Akka.Remote.csproj" /> | ||||||||||||||||||||
<ProjectReference Include="..\..\..\core\Akka.Streams\Akka.Streams.csproj" /> | ||||||||||||||||||||
</ItemGroup> | ||||||||||||||||||||
|
||||||||||||||||||||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did this come up inside the benchmark?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhhhh, it rather involved some Spans and FastHash while I was debugging... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL