Adjust pool size of default-dispatcher. See #1654

* Changed reference.conf
  core-pool-size-min = 6
  core-pool-size-factor = 3.0
  core-pool-size-max = 64
  max-pool-size-min = 6
  max-pool-size-factor  = 3.0
  max-pool-size-max = 64
* Limited to smaller pool size in AkkaSpec
* Adjusted some tests that needed more threads
This commit is contained in:
Patrik Nordwall 2012-01-17 17:28:57 +01:00
parent 387ffe1bce
commit 517fceae34
5 changed files with 49 additions and 11 deletions

View file

@ -9,8 +9,21 @@ import akka.util.duration._
import akka.util.Timeout import akka.util.Timeout
import akka.dispatch.{ Await, Future } import akka.dispatch.{ Await, Future }
object LocalActorRefProviderSpec {
val config = """
akka {
actor {
default-dispatcher {
core-pool-size-min = 8
core-pool-size-max = 16
}
}
}
"""
}
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class LocalActorRefProviderSpec extends AkkaSpec { class LocalActorRefProviderSpec extends AkkaSpec(LocalActorRefProviderSpec.config) {
"An LocalActorRefProvider" must { "An LocalActorRefProvider" must {
"find actor refs using actorFor" in { "find actor refs using actorFor" in {

View file

@ -26,8 +26,8 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference) {
getString("akka.actor.default-dispatcher.type") must equal("Dispatcher") getString("akka.actor.default-dispatcher.type") must equal("Dispatcher")
getString("akka.actor.default-dispatcher.name") must equal("default-dispatcher") getString("akka.actor.default-dispatcher.name") must equal("default-dispatcher")
getMilliseconds("akka.actor.default-dispatcher.keep-alive-time") must equal(60 * 1000) getMilliseconds("akka.actor.default-dispatcher.keep-alive-time") must equal(60 * 1000)
getDouble("akka.actor.default-dispatcher.core-pool-size-factor") must equal(8.0) getDouble("akka.actor.default-dispatcher.core-pool-size-factor") must equal(3.0)
getDouble("akka.actor.default-dispatcher.max-pool-size-factor") must equal(8.0) getDouble("akka.actor.default-dispatcher.max-pool-size-factor") must equal(3.0)
getInt("akka.actor.default-dispatcher.task-queue-size") must equal(-1) getInt("akka.actor.default-dispatcher.task-queue-size") must equal(-1)
getString("akka.actor.default-dispatcher.task-queue-type") must equal("linked") getString("akka.actor.default-dispatcher.task-queue-type") must equal("linked")
getBoolean("akka.actor.default-dispatcher.allow-core-timeout") must equal(true) getBoolean("akka.actor.default-dispatcher.allow-core-timeout") must equal(true)

View file

@ -7,8 +7,21 @@ import akka.testkit._
import akka.util.duration._ import akka.util.duration._
import akka.dispatch.Await import akka.dispatch.Await
object ConfiguredLocalRoutingSpec {
val config = """
akka {
actor {
default-dispatcher {
core-pool-size-min = 8
core-pool-size-max = 16
}
}
}
"""
}
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class ConfiguredLocalRoutingSpec extends AkkaSpec with DefaultTimeout with ImplicitSender { class ConfiguredLocalRoutingSpec extends AkkaSpec(ConfiguredLocalRoutingSpec.config) with DefaultTimeout with ImplicitSender {
val deployer = system.asInstanceOf[ActorSystemImpl].provider.deployer val deployer = system.asInstanceOf[ActorSystemImpl].provider.deployer

View file

@ -165,23 +165,23 @@ akka {
keep-alive-time = 60s keep-alive-time = 60s
# minimum number of threads to cap factor-based core number to # minimum number of threads to cap factor-based core number to
core-pool-size-min = 8 core-pool-size-min = 6
# No of core threads ... ceil(available processors * factor) # No of core threads ... ceil(available processors * factor)
core-pool-size-factor = 8.0 core-pool-size-factor = 3.0
# maximum number of threads to cap factor-based number to # maximum number of threads to cap factor-based number to
core-pool-size-max = 4096 core-pool-size-max = 64
# Hint: max-pool-size is only used for bounded task queues # Hint: max-pool-size is only used for bounded task queues
# minimum number of threads to cap factor-based max number to # minimum number of threads to cap factor-based max number to
max-pool-size-min = 8 max-pool-size-min = 6
# Max no of threads ... ceil(available processors * factor) # Max no of threads ... ceil(available processors * factor)
max-pool-size-factor = 8.0 max-pool-size-factor = 3.0
# maximum number of threads to cap factor-based max number to # maximum number of threads to cap factor-based max number to
max-pool-size-max = 4096 max-pool-size-max = 64
# Specifies the bounded capacity of the task queue (< 1 == unbounded) # Specifies the bounded capacity of the task queue (< 1 == unbounded)
task-queue-size = -1 task-queue-size = -1

View file

@ -14,6 +14,18 @@ import akka.testkit._
import scala.concurrent.stm._ import scala.concurrent.stm._
object CoordinatedIncrement { object CoordinatedIncrement {
val config = """
akka {
actor {
default-dispatcher {
core-pool-size-min = 5
core-pool-size-max = 16
}
}
}
"""
case class Increment(friends: Seq[ActorRef]) case class Increment(friends: Seq[ActorRef])
case object GetCount case object GetCount
@ -49,7 +61,7 @@ object CoordinatedIncrement {
} }
@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner])
class CoordinatedIncrementSpec extends AkkaSpec with BeforeAndAfterAll { class CoordinatedIncrementSpec extends AkkaSpec(CoordinatedIncrement.config) with BeforeAndAfterAll {
import CoordinatedIncrement._ import CoordinatedIncrement._
implicit val timeout = Timeout(5.seconds.dilated) implicit val timeout = Timeout(5.seconds.dilated)