From 74d0a6bc2360519ee2e178e855db0ea682a28b9a Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 2 Jul 2019 10:48:58 +0200 Subject: [PATCH] src/bin/proxmox-backup-proxy.rs: set socket options for max. performance --- src/bin/proxmox-backup-proxy.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs index 03ab11a8..a3255a72 100644 --- a/src/bin/proxmox-backup-proxy.rs +++ b/src/bin/proxmox-backup-proxy.rs @@ -95,7 +95,12 @@ fn run() -> Result<(), Error> { let connections = listener .incoming() .map_err(Error::from) - .and_then(move |sock| acceptor.accept(sock).map_err(|e| e.into())) + .and_then(move |sock| { + sock.set_nodelay(true).unwrap(); + sock.set_send_buffer_size(1024*1024).unwrap(); + sock.set_recv_buffer_size(1024*1024).unwrap(); + acceptor.accept(sock).map_err(|e| e.into()) + }) .then(|r| match r { // accept()s can fail here with an Err() when eg. the client rejects // the cert and closes the connection, so we follow up with mapping