diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-22 16:51:52 +0000 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-22 16:51:52 +0000 |
commit | e8214cb1807d3145907c7ed9e077fa45ada4aeea (patch) | |
tree | 00192416f1c2d2157988a1c07df4601475a30a73 /src/server.rs | |
parent | c0335ac6904598b9ac367e17651da477d4d970d7 (diff) | |
download | garage-e8214cb1807d3145907c7ed9e077fa45ada4aeea.tar.gz garage-e8214cb1807d3145907c7ed9e077fa45ada4aeea.zip |
Better concurrency:
Use Notify instead of stupid sleep in background worker
Use Semaphore to limit concurrent requests in rpc_client
Make more background tasks cancellable
Diffstat (limited to 'src/server.rs')
-rw-r--r-- | src/server.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server.rs b/src/server.rs index 542c8675..7b6f2240 100644 --- a/src/server.rs +++ b/src/server.rs @@ -35,6 +35,9 @@ pub struct Config { pub bootstrap_peers: Vec<SocketAddr>, + #[serde(default = "default_max_concurrent_requests")] + pub max_concurrent_requests: usize, + #[serde(default = "default_block_size")] pub block_size: usize, @@ -50,6 +53,9 @@ pub struct Config { pub rpc_tls: Option<TlsConfig>, } +fn default_max_concurrent_requests() -> usize { + 12 +} fn default_block_size() -> usize { 1048576 } |