I've stumbled on the throughput-deadline-time
configuration property for Akka dispatchers, and it looks like an interesting option, however the only mention of it I could find in the whole documentation is the following:
# Throughput deadline for Dispatcher, set to 0 or negative for no deadline
throughput-deadline-time = 0ms
I think we can agree that this is not very helpful.
So what does throughput-deadline-time
control, and what impact does it have when on my dispatcher?
So I had a look at the Akka source code, and found this method in the
Mailbox
that seems to implement the behavior ofthroughput-deadline-time
:This piece of code makes it clear:
throughput-deadline-time
configures the maximum amount of time that will be spent processing the same mailbox, before switching to the mailbox of another actor.In other words, if you configure a dispatcher with:
Then the mailbox of the actors will process at most 100 messages at a time, during at most 1ms, whenever the first of those limits is hit, Akka switches to another actor/mailbox.