Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agave: add parameter for setting unified scheduler threads #3881

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/fdctl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ typedef struct {
char affinity[ AFFINITY_SZ ];
char agave_affinity[ AFFINITY_SZ ];

uint agave_unified_scheduler_handler_threads;
uint net_tile_count;
uint quic_tile_count;
uint resolv_tile_count;
Expand Down
18 changes: 18 additions & 0 deletions src/app/fdctl/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,24 @@ dynamic_port_range = "8900-9000"
# determined automatically as well.
agave_affinity = "auto"

# The number of threads to spawn per-fork for the unified scheduler.
# The replay stage, which is a part of the Agave subprocess, uses
# these threads for transaction execution. The threads stay within
# the cores dedicated to the Agave subprocess.
#
# If set to 0, the default depends on the number of cores available
# to the agave subprocess.
#
# agave_cores >= 8 => agave_cores - 4
# 4 <= agave_cores < 8 => 4
# agave_cores < 4 => agave_cores
#
# Increasing the value for this parameter might help during the
# start-up phase when the validator is trying to catchup to the
# cluster. It may also help the node stay caught up if it keeps
# falling behind.
agave_unified_scheduler_handler_threads = 0

# How many net tiles to run. Should be set to 1. This is
# configurable and designed to scale out for future network
# conditions but there is no need to run more than 1 net tile given
Expand Down
1 change: 1 addition & 0 deletions src/app/fdctl/config_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ fdctl_pod_to_cfg( config_t * config,

CFG_POP ( cstr, layout.affinity );
CFG_POP ( cstr, layout.agave_affinity );
CFG_POP ( uint, layout.agave_unified_scheduler_handler_threads );
anwayde marked this conversation as resolved.
Show resolved Hide resolved
CFG_POP ( uint, layout.net_tile_count );
CFG_POP ( uint, layout.quic_tile_count );
CFG_POP ( uint, layout.resolv_tile_count );
Expand Down
13 changes: 13 additions & 0 deletions src/app/fdctl/run/run_agave.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,19 @@ agave_boot( config_t * config ) {
ADDU( "--maximum-incremental-snapshots-to-retain", config->snapshots.maximum_incremental_snapshots_to_retain );
ADDU( "--minimal-snapshot-download-speed", config->snapshots.minimum_snapshot_download_speed );

if( config->layout.agave_unified_scheduler_handler_threads ) {
if( FD_UNLIKELY( config->layout.agave_unified_scheduler_handler_threads>config->topo.agave_affinity_cnt ) ) {
FD_LOG_ERR(( "Trying to spawn %u handler threads but the agave subprocess has %lu cores. "
"Either increase the number of cores in [layout.agave_affinity] or reduce "
"the number of threads in [layout.agave_unified_scheduler_handler_threads].",
config->layout.agave_unified_scheduler_handler_threads, config->topo.agave_affinity_cnt ));
}
ADDU( "--unified-scheduler-handler-threads", config->layout.agave_unified_scheduler_handler_threads );
} else {
ulong num_threads = fd_ulong_max( config->topo.agave_affinity_cnt-4UL, fd_ulong_min( config->topo.agave_affinity_cnt, 4UL ) );
ADDU( "--unified-scheduler-handler-threads", (uint)num_threads );
}

argv[ idx ] = NULL;

if( FD_LIKELY( strcmp( config->reporting.solana_metrics_config, "" ) ) ) {
Expand Down
Loading