Config

kyo.scheduler.Scheduler.Config
See theConfig companion object
case class Config(cores: Int, coreWorkers: Int, minWorkers: Int, maxWorkers: Int, scheduleStride: Int, stealStride: Int, virtualizeWorkers: Boolean, timeSliceMs: Int, cycleIntervalNs: Int, enableTopJMX: Boolean, enableTopConsoleMs: Int)

Configuration parameters controlling worker behavior and performance characteristics.

Most applications can use the default worker configuration values, which are tuned for general-purpose workloads. The defaults are configured through system properties and provide good performance across a wide range of scenarios without requiring manual tuning.

Value parameters

coreWorkers

Initial worker thread count at scheduler startup. Represents the baseline capacity for handling normal workload. (-Dkyo.scheduler.coreWorkers= , default: cores * 10)

cycleIntervalNs

Interval between worker health checks in nanoseconds. Controls how quickly the scheduler detects and responds to stalled or blocked workers. (-Dkyo.scheduler.cycleIntervalNs= , default: 100000)

enableTopConsoleMs

Interval in milliseconds for printing scheduler metrics to console. Zero disables console output. Useful for development and debugging. (-Dkyo.scheduler.enableTopConsoleMs= , default: 0)

enableTopJMX

Exposes scheduler metrics through JMX for monitoring. Useful for observing scheduler behavior in production. (-Dkyo.scheduler.enableTopJMX= , default: true)

maxWorkers

Maximum worker thread count beyond which the scheduler won't allocate new workers. Prevents unconstrained thread growth under heavy load. Must be greater than or equal to minWorkers. (-Dkyo.scheduler.maxWorkers= , default: coreWorkers * 100)

minWorkers

Minimum number of worker threads that will be maintained even under low load. A lower number conserves resources but may require ramp-up time when load increases. (-Dkyo.scheduler.minWorkers= , default: coreWorkers/2)

scheduleStride

Number of workers to examine when scheduling a new task. Larger values find better scheduling targets but take longer to make decisions. (-Dkyo.scheduler.scheduleStride= , default: cores)

stealStride

Number of workers to examine when looking for tasks to steal. Larger values improve load balancing but increase steal overhead. (-Dkyo.scheduler.stealStride= , default: cores * 4)

timeSliceMs

Maximum duration a task can run before being preempted. Lower values (e.g. 5ms) ensure more frequent task switching and better responsiveness. Higher values (e.g. 20ms) reduce context switching overhead but may delay other tasks. (-Dkyo.scheduler.timeSliceMs= , default: 10)

virtualizeWorkers

When true, uses virtual threads from Project Loom instead of platform threads. Beneficial for workloads with significant I/O or blocking operations. Requires JDK 21+ and appropriate JVM flags. (-Dkyo.scheduler.virtualizeWorkers= , default: false)

Attributes

See also

Worker for worker implementation details

Scheduler for how workers are managed

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product