Skip to content

Commit

Permalink
shard_server: Increase tower-buffer size + explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayknarayan committed Mar 2, 2020
1 parent 4d909ae commit 8e91a9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kvstore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ where
// start the shards
let shards: Vec<_> = shard_listeners
.map(move |listener| {
// The channel size passed to new() should be >= the maximum num. of concurrent requests.
let srv = tower_buffer::Buffer::new(Store::default(), 100_000);
let shard_srv = srv.clone();

Expand All @@ -109,7 +110,7 @@ where
// if shards.len() == 0, then there can only be one shard: sharder_listen. So, we just serve directly and
// ignore `shard_fn`.
if shards.is_empty() {
let srv = tower_buffer::Buffer::new(Store::default(), 100);
let srv = tower_buffer::Buffer::new(Store::default(), 100_000);
sharder_listen
.for_each_concurrent(None, move |st| serve(st.unwrap(), srv.clone()))
.await;
Expand Down

0 comments on commit 8e91a9f

Please sign in to comment.