Add the parameter, which replaces . This is to accommodate different storage media such as HDD and NVMe.

This commit is contained in:
perrynzhou@gmail.com
2025-12-10 06:43:51 +08:00
parent d769a7be5d
commit 4d124e1c76
2 changed files with 9 additions and 3 deletions
+8
View File
@@ -45,6 +45,11 @@ pub struct Config {
)]
pub block_size: usize,
/// Maximum number of parallel block writes per PUT request
/// Higher values improve throughput but increase memory usage
/// Default: 3, Recommended: 10-30 for NVMe, 3-10 for HDD
#[serde(default = "default_put_blocks_max_parallel")]
pub put_blocks_max_parallel: usize,
/// Number of replicas. Can be any positive integer, but uneven numbers are more favorable.
/// - 1 for single-node clusters, or to disable replication
/// - 3 is the recommended and supported setting.
@@ -267,6 +272,9 @@ pub struct KubernetesDiscoveryConfig {
pub skip_crd: bool,
}
pub fn default_put_blocks_max_parallel() -> usize {
3
}
/// Read and parse configuration
pub fn read_config(config_file: PathBuf) -> Result<Config, Error> {
let config = std::fs::read_to_string(config_file)?;