actor_system_config

The CPU resources are mainly used by the actor system. Depending on the type, all actors run in one of the pools (the name parameter). Configuration involves allocating a node's CPU cores across the actor system pools. When allocating them, please keep in mind that PDisks and the gRPC API run outside the actor system and require separate resources.

You can set up your actor system either automatically or manually. In the actor_system_config section, specify:

  • Node type and the number of CPU cores allocated to the ydbd process by automatic configuration.
  • Number of CPU cores for each YDB cluster subsystem in the case of manual configuration.

Automatic configuration adapts to the current system workload. It is recommended in most cases.

You might opt for manual configuration when a certain pool in your actor system is overwhelmed and undermines the overall database performance. You can track the workload on your pools on the Embedded UI monitoring page.

Automatic Configuring

Example of the actor_system_config section for automatic configuration of the actor system:

actor_system_config:
  use_auto_config: true
  node_type: STORAGE
  cpu_count: 10
Parameter Description
use_auto_config Enabling automatic configuration of the actor system.
node_type Node type. Determines the expected workload and vCPU ratio between the pools. Possible values:
  • STORAGE: The node interacts with network block store volumes and is responsible for managing the Distributed Storage.
  • COMPUTE: The node processes the workload generated by users.
  • HYBRID: The node is used for hybrid load or the usage of System, User, and IC for the node under load is about the same.
cpu_count Number of vCPUs allocated to the node.

Manual Configuring

Example of the actor_system_config section for manual configuration of the actor system:

actor_system_config:
  executor:
  - name: System
    spin_threshold: 0
    threads: 2
    type: BASIC
  - name: User
    spin_threshold: 0
    threads: 3
    type: BASIC
  - name: Batch
    spin_threshold: 0
    threads: 2
    type: BASIC
  - name: IO
    threads: 1
    time_per_mailbox_micro_secs: 100
    type: IO
  - name: IC
    spin_threshold: 10
    threads: 1
    time_per_mailbox_micro_secs: 100
    type: BASIC
  scheduler:
    progress_threshold: 10000
    resolution: 256
    spin_threshold: 0
Parameter Description
executor Pool configuration.
You should only change the number of CPU cores (the threads parameter) in the pool configs.
name Pool name that indicates its purpose. Possible values:
  • System: A pool that is designed for running quick internal operations in YDB (it serves system tablets, state storage, distributed storage I/O, and erasure coding).
  • User: A pool that serves the user load (user tablets, queries run in the Query Processor).
  • Batch: A pool that serves tasks with no strict limit on the execution time, background operations like garbage collection and heavy queries run in the Query Processor.
  • IO: A pool responsible for performing any tasks with blocking operations (such as authentication or writing logs to a file).
  • IC: Interconnect, it serves the load related to internode communication (system calls to wait for sending and send data across the network, data serialization, as well as message splits and merges).
spin_threshold The number of CPU cycles before going to sleep if there are no messages. In sleep mode, there is less power consumption, but it may increase request latency under low loads.
threads The number of CPU cores allocated per pool.
Make sure the total number of cores assigned to the System, User, Batch, and IC pools does not exceed the number of available system cores.
max_threads Maximum vCPU that can be allocated to the pool from idle cores of other pools. When you set this parameter, the system enables the mechanism of expanding the pool at full utilization, provided that idle vCPUs are available.
The system checks the current utilization and reallocates vCPUs once per second.
max_avg_ping_deviation Additional condition to expand the pool's vCPU. When more than 90% of vCPUs allocated to the pool are utilized, you need to worsen SelfPing by more than max_avg_ping_deviation microseconds from 10 milliseconds expected.
time_per_mailbox_micro_secs The number of messages per actor to be handled before switching to a different actor.
type Pool type. Possible values:
  • IO should be set for IO pools.
  • BASIC should be set for any other pool.
scheduler Scheduler configuration. The actor system scheduler is responsible for the delivery of deferred messages exchanged by actors.
We do not recommend changing the default scheduler parameters.
progress_threshold The actor system supports requesting message sending scheduled for a later point in time. The system might fail to send all scheduled messages at some point. In this case, it starts sending them in "virtual time" by handling message sending in each loop over a period that doesn't exceed the progress_threshold value in microseconds and shifting the virtual time by the progress_threshold value until it reaches real time.
resolution When making a schedule for sending messages, discrete time slots are used. The slot duration is set by the resolution parameter in microseconds.