Change default tick-duration to 10ms, see #3387
This commit is contained in:
parent
28d1b1f187
commit
c05262f406
6 changed files with 9 additions and 65 deletions
|
|
@ -202,7 +202,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit
|
|||
case Msg(ts) ⇒
|
||||
val now = System.nanoTime
|
||||
// Make sure that no message has been dispatched before the scheduled time (10ms) has occurred
|
||||
if (now - ts < 10.millis.toNanos) throw new RuntimeException("Interval is too small: " + (now - ts))
|
||||
if (now - ts < 5.millis.toNanos) throw new RuntimeException("Interval is too small: " + (now - ts))
|
||||
ticks.countDown()
|
||||
}
|
||||
}))
|
||||
|
|
@ -296,22 +296,6 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit
|
|||
class DefaultSchedulerSpec extends AkkaSpec(SchedulerSpec.testConf) with SchedulerSpec {
|
||||
private val cancellables = new ConcurrentLinkedQueue[Cancellable]()
|
||||
|
||||
"A HashedWheelTimer" must {
|
||||
|
||||
"not mess up long timeouts" taggedAs LongRunningTest in {
|
||||
val longish = Long.MaxValue.nanos
|
||||
val barrier = TestLatch()
|
||||
import system.dispatcher
|
||||
val job = system.scheduler.scheduleOnce(longish)(barrier.countDown())
|
||||
intercept[TimeoutException] {
|
||||
// this used to fire after 46 seconds due to wrap-around
|
||||
Await.ready(barrier, 90 seconds)
|
||||
}
|
||||
job.cancel()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def collectCancellable(c: Cancellable): Cancellable = {
|
||||
cancellables.add(c)
|
||||
c
|
||||
|
|
@ -325,7 +309,6 @@ class DefaultSchedulerSpec extends AkkaSpec(SchedulerSpec.testConf) with Schedul
|
|||
}
|
||||
}
|
||||
|
||||
override def expectedTestDuration = 5 minutes
|
||||
}
|
||||
|
||||
class LightArrayRevolverSchedulerSpec extends AkkaSpec(SchedulerSpec.testConfRevolver) with SchedulerSpec {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin
|
|||
settings.SerializeAllMessages must equal(false)
|
||||
|
||||
getInt("akka.scheduler.ticks-per-wheel") must equal(512)
|
||||
getMilliseconds("akka.scheduler.tick-duration") must equal(100)
|
||||
getMilliseconds("akka.scheduler.tick-duration") must equal(10)
|
||||
getString("akka.scheduler.implementation") must equal("akka.actor.LightArrayRevolverScheduler")
|
||||
|
||||
getBoolean("akka.daemonic") must be(false)
|
||||
|
|
|
|||
|
|
@ -396,19 +396,16 @@ akka {
|
|||
# sure you know what you're doing! See the Scheduler section of the Akka
|
||||
# Documentation for more details.
|
||||
scheduler {
|
||||
# The HashedWheelTimer (HWT) implementation from Netty is used as the default
|
||||
# scheduler in the system.
|
||||
# HWT does not execute the scheduled tasks on exact time.
|
||||
# It will, on every tick, check if there are any tasks behind the schedule
|
||||
# and execute them. You can increase or decrease the accuracy of the execution
|
||||
# timing by specifying smaller or larger tick duration.
|
||||
# If you are scheduling a lot of tasks you should consider increasing the
|
||||
# ticks per wheel.
|
||||
# For more information see: http://www.jboss.org/netty/
|
||||
# The LightArrayRevolverScheduler is used as the default scheduler in the
|
||||
# system. It does not execute the scheduled tasks on exact time, but on every
|
||||
# tick, it will run everything that is (over)due. You can increase or decrease
|
||||
# the accuracy of the execution timing by specifying smaller or larger tick
|
||||
# duration. If you are scheduling a lot of tasks you should consider increasing
|
||||
# the ticks per wheel.
|
||||
# Note that it might take up to 1 tick to stop the Timer, so setting the
|
||||
# tick-duration to a high value will make shutting down the actor system
|
||||
# take longer.
|
||||
tick-duration = 100ms
|
||||
tick-duration = 10ms
|
||||
|
||||
# The timer uses a circular wheel of buckets to store the timer tasks.
|
||||
# This should be set such that the majority of scheduled timeouts (for high
|
||||
|
|
@ -421,7 +418,6 @@ akka {
|
|||
# system start-up. Built-in choices are:
|
||||
# - akka.actor.LightArrayRevolverScheduler
|
||||
# - akka.actor.DefaultScheduler (HWT) DEPRECATED
|
||||
# (to be benchmarked and evaluated)
|
||||
# The class given here must implement the akka.actor.Scheduler interface
|
||||
# and offer a public constructor which takes three arguments:
|
||||
# 1) com.typesafe.config.Config
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig {
|
|||
akka.loglevel = INFO
|
||||
akka.remote.log-remote-lifecycle-events = off
|
||||
|
||||
#akka.scheduler.tick-duration = 33 ms
|
||||
akka.actor.default-dispatcher.fork-join-executor {
|
||||
parallelism-min = 8
|
||||
parallelism-max = 8
|
||||
|
|
|
|||
|
|
@ -710,20 +710,3 @@ Cluster Info Logging
|
|||
You can silence the logging of cluster events at info level with configuration property::
|
||||
|
||||
akka.cluster.log-info = off
|
||||
|
||||
Cluster Scheduler
|
||||
-----------------
|
||||
|
||||
It is recommended that you change the ``tick-duration`` to 33 ms or less
|
||||
of the default scheduler when using cluster, if you don't need to have it
|
||||
configured to a longer duration for other reasons. If you don't do this
|
||||
a dedicated scheduler will be used for periodic tasks of the cluster, which
|
||||
introduce the extra overhead of another thread.
|
||||
|
||||
::
|
||||
|
||||
# shorter tick-duration of default scheduler when using cluster
|
||||
akka.scheduler.tick-duration = 33ms
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -730,20 +730,3 @@ Cluster Info Logging
|
|||
You can silence the logging of cluster events at info level with configuration property::
|
||||
|
||||
akka.cluster.log-info = off
|
||||
|
||||
Cluster Scheduler
|
||||
-----------------
|
||||
|
||||
It is recommended that you change the ``tick-duration`` to 33 ms or less
|
||||
of the default scheduler when using cluster, if you don't need to have it
|
||||
configured to a longer duration for other reasons. If you don't do this
|
||||
a dedicated scheduler will be used for periodic tasks of the cluster, which
|
||||
introduce the extra overhead of another thread.
|
||||
|
||||
::
|
||||
|
||||
# shorter tick-duration of default scheduler when using cluster
|
||||
akka.scheduler.tick-duration = 33ms
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue