# Akka Stream Reference Config File #
#####################################
+# eager creation of the system wide materializer
+akka.library-extensions += "akka.stream.SystemMaterializer$"
akka {
stream {
max-input-buffer-size = 16
# Fully qualified config path which holds the dispatcher configuration
- # to be used by ActorMaterializer when creating Actors.
- # When this value is left empty, the default-dispatcher will be used.
- dispatcher = ""
+ # or full dispatcher configuration to be used by ActorMaterializer when creating Actors.
+ dispatcher = "akka.actor.default-dispatcher"
- blocking-io-dispatcher = "akka.stream.default-blocking-io-dispatcher"
+ # Fully qualified config path which holds the dispatcher configuration
+ # or full dispatcher configuration to be used by stream operators that
+ # perform blocking operations
+ blocking-io-dispatcher = "akka.actor.default-blocking-io-dispatcher"
# Cleanup leaked publishers and subscribers when they are not used within a given
# deadline
}
io.tcp {
- # The outgoing bytes are accumulated in a buffer while waiting for acknoledgment
+ # The outgoing bytes are accumulated in a buffer while waiting for acknowledgment
# of pending write. This improves throughput for small messages (frames) without
# sacrificing latency. While waiting for the ack the stage will eagerly pull
# from upstream until the buffer exceeds this size. That means that the buffer may hold
# slightly more bytes than this limit (at most one element more). It can be set to 0
# to disable the usage of the buffer.
write-buffer-size = 16 KiB
+
+ # In addition to the buffering described for property write-buffer-size, try to collect
+ # more consecutive writes from the upstream stream producers.
+ #
+ # The rationale is to increase write efficiency by avoiding separate small
+ # writes to the network which is expensive to do. Merging those writes together
+ # (up to `write-buffer-size`) improves throughput for small writes.
+ #
+ # The idea is that a running stream may produce multiple small writes consecutively
+ # in one go without waiting for any external input. To probe the stream for
+ # data, this features delays sending a write immediately by probing the stream
+ # for more writes. This works by rescheduling the TCP connection stage via the
+ # actor mailbox of the underlying actor. Thus, before the stage is reactivated
+ # the upstream gets another opportunity to emit writes.
+ #
+ # When the stage is reactivated and if new writes are detected another round-trip
+ # is scheduled. The loop repeats until either the number of round trips given in this
+ # setting is reached, the buffer reaches `write-buffer-size`, or no new writes
+ # were detected during the last round-trip.
+ #
+ # This mechanism ensures that a write is guaranteed to be sent when the remaining stream
+ # becomes idle waiting for external signals.
+ #
+ # In most cases, the extra latency this mechanism introduces should be negligible,
+ # but depending on the stream setup it may introduce a noticeable delay,
+ # if the upstream continuously produces small amounts of writes in a
+ # blocking (CPU-bound) way.
+ #
+ # In that case, the feature can either be disabled, or the producing CPU-bound
+ # work can be taken off-stream to avoid excessive delays (e.g. using `mapAsync` instead of `map`).
+ #
+ # A value of 0 disables this feature.
+ coalesce-writes = 10
}
+ # Time to wait for async materializer creation before throwing an exception
+ creation-timeout = 20 seconds
+
//#stream-ref
# configure defaults for SourceRef and SinkRef
stream-ref {
//#stream-ref
}
- # Deprecated, use akka.stream.materializer.blocking-io-dispatcher, this setting
- # was never applied because of bug #24357
- # It must still have a valid value because used from Akka HTTP.
- blocking-io-dispatcher = "akka.stream.default-blocking-io-dispatcher"
-
- default-blocking-io-dispatcher {
- type = "Dispatcher"
- executor = "thread-pool-executor"
- throughput = 1
-
- thread-pool-executor {
- fixed-pool-size = 16
- }
- }
+ # Deprecated, left here to not break Akka HTTP which refers to it
+ blocking-io-dispatcher = "akka.actor.default-blocking-io-dispatcher"
+ # Deprecated, will not be used unless user code refer to it, use 'akka.stream.materializer.blocking-io-dispatcher'
+ # instead, or if from code, prefer the 'ActorAttributes.IODispatcher' attribute
+ default-blocking-io-dispatcher = "akka.actor.default-blocking-io-dispatcher"
}
# configure overrides to ssl-configuration here (to be used by akka-streams, and akka-http – i.e. when serving https connections)