diff options
author | Alex Auvolat <alex@adnab.me> | 2021-05-03 17:27:43 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-05-03 17:27:43 +0200 |
commit | 575726358c72772b7be00d0f8eaff76506118f7a (patch) | |
tree | a70969ceea0606c0634f5a88e111418219842bbe /src/garage | |
parent | 339c61178948c6d504578344aadedd2cfb80e42b (diff) | |
download | garage-575726358c72772b7be00d0f8eaff76506118f7a.tar.gz garage-575726358c72772b7be00d0f8eaff76506118f7a.zip |
Tune Sled configuration
- Make sled cache size and flush interval configurable
- Set less agressive default values:
- cache size 128MB instead of 1GB
- Flush interval 2 seconds instead of .5 seconds
Diffstat (limited to 'src/garage')
-rw-r--r-- | src/garage/server.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/garage/server.rs b/src/garage/server.rs index 97a9bec2..3004d3d2 100644 --- a/src/garage/server.rs +++ b/src/garage/server.rs @@ -40,7 +40,12 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> { info!("Opening database..."); let mut db_path = config.metadata_dir.clone(); db_path.push("db"); - let db = sled::open(&db_path).expect("Unable to open sled DB"); + let db = sled::Config::default() + .path(&db_path) + .cache_capacity(config.sled_cache_capacity) + .flush_every_ms(Some(config.sled_flush_every_ms)) + .open() + .expect("Unable to open sled DB"); info!("Initialize RPC server..."); let mut rpc_server = RpcServer::new(config.rpc_bind_addr.clone(), config.rpc_tls.clone()); |