From e8d34811086c6c958b52542903f4466552ead58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Fri, 13 Jul 2018 09:48:39 +0200 Subject: [PATCH] the size is not bytes but objects and objects were byte arrays (typically 8KB). limit it to 64, so typically not more than 512kb is used. doesn't change the max speed when downloading on localhost, and decreases the RSS usage with slow clients. --- src/channel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/channel.rs b/src/channel.rs index 9741b6c..7c7c2d9 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -19,7 +19,7 @@ type BlockingSender = futures::sink::Wait; pub fn stream_tar_in_thread(path: PathBuf) -> Stream { - let (writer, stream) = StreamWriter::new(4 * 1024 * 1024); + let (writer, stream) = StreamWriter::new(64); thread::spawn(move || { let mut a = tar::Builder::new(writer);