diff --git a/crates/tinymold-remote/src/client/mod.rs b/crates/tinymold-remote/src/client/mod.rs index c3adc7a..3d898ad 100644 --- a/crates/tinymold-remote/src/client/mod.rs +++ b/crates/tinymold-remote/src/client/mod.rs @@ -60,7 +60,12 @@ impl Client { pub(crate) fn new(config: &RemoteConfig) -> Result { let mut endpoint = Endpoint::from_shared(config.endpoint.clone()) .map_err(Error::Connect)? - .connect_timeout(config.timeout); + .connect_timeout(config.timeout) + // With hyper's fixed windows (2 MiB a stream, 5 MiB a + // connection), a read can move at most one window per round + // trip, however fast the link; adaptive windows grow to the + // bandwidth-delay product. + .http2_adaptive_window(true); if config.uses_tls() { endpoint = endpoint .tls_config(ClientTlsConfig::new().with_webpki_roots()) diff --git a/docs/specs/remote.md b/docs/specs/remote.md index d115c2d..3f95f1b 100644 --- a/docs/specs/remote.md +++ b/docs/specs/remote.md @@ -94,7 +94,9 @@ sharing a key. outcome is `remote`. Calls go through ByteStream `Read` for blobs, so blob size is not limited -by the gRPC message size. Once an entry's signature checks out, its +by the gRPC message size. The connection uses HTTP/2 adaptive flow-control +windows, so reads from a distant cache are not held to a fixed window per +round trip. Once an entry's signature checks out, its objects and its record are read together, within the same limits as a push's uploads (below), and a pre-key lookup reads its signature and record together: each read is a round trip,