From 0d350aac7f70487bc28bae0d0f457155a4e19081 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Wed, 8 Aug 2018 10:24:53 -0700 Subject: Enable SACK in runsc SACK is disabled by default and needs to be manually enabled. It not only improves performance, but also fixes hangs downloading files from certain websites. PiperOrigin-RevId: 207906742 Change-Id: I4fb7277b67bfdf83ac8195f1b9c38265a0d51e8b --- pkg/sentry/socket/hostinet/stack.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkg/sentry') diff --git a/pkg/sentry/socket/hostinet/stack.go b/pkg/sentry/socket/hostinet/stack.go index 44c3b9a3f..f64809d39 100644 --- a/pkg/sentry/socket/hostinet/stack.go +++ b/pkg/sentry/socket/hostinet/stack.go @@ -84,11 +84,13 @@ func (s *Stack) Configure() error { log.Warningf("Failed to read TCP send buffer size, using default values") } - s.tcpSACKEnabled = false + // SACK is important for performance and even compatibility, assume it's + // enabled if we can't find the actual value. + s.tcpSACKEnabled = true if sack, err := ioutil.ReadFile("/proc/sys/net/ipv4/tcp_sack"); err == nil { s.tcpSACKEnabled = strings.TrimSpace(string(sack)) != "0" } else { - log.Warningf("Failed to read if TCP SACK if enabled, setting to false") + log.Warningf("Failed to read if TCP SACK if enabled, setting to true") } return nil -- cgit v1.2.3