Skip to content
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
3 changes: 2 additions & 1 deletion crates/walrus-service/node_config_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ db_config:
keep_log_file_num: 50
wal_ttl_seconds: 172800
wal_size_limit_mb: 10240
enable_statistics: false
max_background_jobs: 16
enable_statistics: true
use_optimistic_transaction_db: true
standard:
enable_blob_files: false
Expand Down
9 changes: 8 additions & 1 deletion crates/walrus-service/src/node/storage/database_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ pub struct GlobalDatabaseOptions {
pub wal_ttl_seconds: Option<u64>,
/// The size limit for the WAL in MB.
pub wal_size_limit_mb: Option<u64>,
/// The maximum number of background jobs (compactions + flushes).
pub max_background_jobs: Option<i32>,
/// Whether to enable statistics.
pub enable_statistics: bool,
/// If true, databases are opened using `OptimisticTransactionDB` instead of the standard DB.
Expand All @@ -244,7 +246,8 @@ impl Default for GlobalDatabaseOptions {
keep_log_file_num: Some(50),
wal_ttl_seconds: Some(60 * 60 * 24 * 2), // 2 days,
wal_size_limit_mb: Some(10 * 1024), // 10 GB,
enable_statistics: false,
max_background_jobs: Some(16),
enable_statistics: true,
use_optimistic_transaction_db: true,
}
}
Expand Down Expand Up @@ -282,6 +285,10 @@ impl From<&GlobalDatabaseOptions> for Options {
options.set_wal_size_limit_mb(wal_size_limit_mb);
}

if let Some(max_background_jobs) = value.max_background_jobs {
options.set_max_background_jobs(max_background_jobs);
}

if value.enable_statistics {
options.enable_statistics();
options.set_statistics_level(StatsLevel::ExceptHistogramOrTimers);
Expand Down
Loading