=rem #21365 less aggressive busy spinning in AeronSource

Benchmarks revealed that busy spinning directly in the graph stage can
lead to an excessive increase in latency when multiple inbound lanes are
active (i.e. the inbound flow has an asynchronous boundary driving the
multiple lanes).

The new strategy is therefore:

For inbound-lanes > 1 or idle-cpu-level < 5: no spinning in the graph stage
For inbound-lanes = 1 and idle-cpu-level >= 6: 50 * settings.Advanced.IdleCpuLevel - 240

which means in general much less or no spinning at all.

Fixes #21365.
This commit is contained in:
Johannes Rudolph 2016-12-30 15:05:21 +01:00
parent e66cb028b0
commit af377790b0
No known key found for this signature in database
GPG key ID: 52AF1C9ABD77E6E5
6 changed files with 16 additions and 10 deletions

View file

@ -58,7 +58,7 @@ class AeronSinkSpec extends AkkaSpec with ImplicitSender {
val port = SocketUtil.temporaryServerAddress("localhost", udp = true).getPort
val channel = s"aeron:udp?endpoint=localhost:$port"
Source.fromGraph(new AeronSource(channel, 1, aeron, taskRunner, pool, IgnoreEventSink))
Source.fromGraph(new AeronSource(channel, 1, aeron, taskRunner, pool, IgnoreEventSink, 0))
// fail receiver stream on first message
.map(_ throw new RuntimeException("stop") with NoStackTrace)
.runWith(Sink.ignore)