POOL: Provide a default actor pool configuration
The boilerplate to use an actor pool is pretty big and requires a lot of scrubbing around in the docs/source to figure out. It would be nice if some reasonable setup were available preconfigured. It could be as simple as making all the configurable values have defaults, rather than leaving them abstract, or it could be a trait similar in spirit to this:
It's true that it's hard to know good values for all this, but that's maybe all the more reason to have some defaults. App developers don't know what to start with either, so they may as well have some defaults and then if they tune later they can override.
Another option or elaboration could be to have a ConfigurableActorPool that takes some sort of config name and builds the actor pool from that, but with defaults for settings that aren't in the config.
trait CPUBoundActorPool
extends DefaultActorPool
with SmallestMailboxSelector
with BoundedCapacityStrategy
with MailboxPressureCapacitor
with Filter
with BasicRampup
with BasicBackoff {
self: Actor =>
override def selectionCount = 1
override def partialFill = true
override val lowerBound = 1
override lazy val upperBound = Runtime.getRuntime().availableProcessors() * 2
override val pressureThreshold = 1
override def rampupRate = 0.2
override def backoffThreshold = 0.7
override def backoffRate = 0.20
}
It's true that it's hard to know good values for all this, but that's maybe all the more reason to have some defaults. App developers don't know what to start with either, so they may as well have some defaults and then if they tune later they can override.
Another option or elaboration could be to have a ConfigurableActorPool that takes some sort of config name and builds the actor pool from that, but with defaults for settings that aren't in the config.
Leave a comment
on 2011-10-07 15:46 *
By viktorklang
Summary changed from Provide a default actor pool configuration to POOL: Provide a default actor pool configuration
Solved with dynamically resizable routers, #1557.